Subject How to reconnect to database
Author Andreas Bednarek
Hello everyone!

Isn't there really anybody, who knows the solution? This must be a common
problem. I also searched the archive but was not succesfull, so I'll try it
once again, maybe I'm just missing something simple, but don't know what...

Please how can I reconnect to DB (FB1.5 RC7) when the connection has been
lost? For example if the cable is disconnected and the connected again.
Beacuse the TIBODatabase.Connected property remains True (why?!?), the only
way is probably to listen to the exception (I use the IBO Data Access
components to connect do DB)

I implemented an TIBODatabase.OnError event handler, where it looks roughly
like this:

if ERRCODE = 335544721 then begin
Disconnect;
Connect;
end;


This works pretty well EXCEPT that calling Disconnect displays an
message box 'Dataset is currently fetching' and you have to
click 'OK' !!! For me It is necessary to avoid that dialog.

I'm also not sure about the value 335544721 which has been discovered
empiricaly.


Do you know how to correctly reconnect to a (remote) FB database using
TIBODatabase?

thank you very much
Andreas