Subject Re: [IBO] How to reconnect to DB
Author Helen Borrie
At 02:07 PM 16/12/2003 +0000, you wrote:
>Hello,
>
>I establish a TCP/IP connection to a remote Firebird1.5RC7 DB (using
>TIBODatabase), when the server goes down or the cable is
>disconnected and then the server started and/or cable plugged in
>again, the connection is lost. Accessing opened tables causes an
>exception.
>
>TIBODatabase.Connected and TIBOTable.Active remain True, so my
>attempts
>'if not Connected then Connect' for the database and
>'if not Active then Open' for the tables
>don't solve that.

That's right.
What you do is catch the exception and (I think) call
IB_Connection.ForceDisconnect.


>Please, how to reconnect to the DB again, how to realize the
>connection has been lost meanwhile?

Listen for the exception. Write a handler that can be called from the
OnError event when this exception is detected.

Helen