Re: Cant trap Exception.



Thanks yannis!
Just found the problem. Yesterday, I had some other problems, and then I put
in an event handler for AfterConnect. In this event handler I had a
"ShowMessage(Error.Message), and it was this message box I was seeing.
Pretty embarrassed here now:) When removing my ShowMessage, my code works
fine.

regards
Karl


"yannis" <none@xxxxxxxxxx> wrote in message
news:mn.9aeb7d8233b63fd3.0@xxxxxxxxxxxxx
Karl A. Sørensen laid this down on his screen :
Any idea on how to catch this exception (removing the message box) ?

Yes.

1) Close the connection object (lConnection.Connected := false) from you
designer before compiling your project.

2) change the exception handling code from
except
iRetVal := 0;
end;

To

except
On E:Exception do
begin
iRetVal := 0;
end;
end;

Regards
Yannis.

--
You talk a great deal about building a better world for your children, but
when you are young you can no more envision a world inherited by your
children than you can conceive of dying. The society you mold, you mold
for yourself.
----Russell Baker-------




.