|Subject||Re: [IBO] How to reconnect to DB II|
> Please how can I reconnect do DB (FB1.5 RC7) when the connection hasroughly
> been lost? Beacuse the TIBODatabase.Connected property remains True, the
> only way is probably to listen to the exception.
> I implemented an TIBODatabase.OnError event handler, where it looks
> like this:Do NOT make any calls in the OnError event like Disconnect or Connect.
> if ERRCODE = 335544721 then begin
> This works pretty well except that calling Disconnect displays an
> message box 'Dataset is currently fetching' and you have to
> click 'OK' !!!
> It is necessary to avoid that dialog. I'm also not sure about the value
> 335544721 which has been discovered empiricaly.
That is the wrong place to react to an error.
You should only set flags and most of the time raise an exception or allow
the default exception to be raised.