Subject Re: [IBO] Intercept connect failure
Author Helen Borrie
At 10:54 AM 14-05-01 +0000, you wrote:
>Hy,
>
>Just a little question. How can i intercept from IB_CONNECTION a connect
>failure at creation ?
>
>When i develop on my computer i have a connection on my server. But when i
>give my program, a connect failure appear who terminate my application. I
>must to close connection before compile but i prefere intercept the connect
>failure for asking a new server.
>
>How can i do it ?

if not IB_Connection1.Connected then
try
IB_Connection1.Connect;
except
(* Handle the error *);
end;
if not IB_Connection1.Connected then
begin
(* Handle the error *);
Exit;
end;

It would also be quite a good idea to find out why your app won't connect. :) Do you understand that you must deliberately call Connect to open the connection?

Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________