Subject
Author Jack Cane
Would appreciate a pointer to some sample code showing how to trap SQL
errors. Looked in the samples but my search mask is too broad (except or
try).

Am trying to trap errors in the ExecSQL method of tIboSql. The code I wrote
is as follows. Comment below shows what actually happens when an exception
is raised.

SqlError := '';
with TheQuery do begin
close;
with sql do begin
Clear;
Add( SQLCommand );
end;
try
ExecSQL;
(*
ExecSQL fails with an error message; the exception is not handled below. I
receive a debugger exception notification stating that my project raised
exception class EIBO_ISCError with 'ISC ERROR CODE:nnn, and an ISC ERROR
MESSAGE
*)
except
on e:exception do
SqlError := e.Message;
{ end }
{ end except }
end;
if SqlError <> '' then
if pWebApp <> nil then
SendErrorToWebServer
else
ShowMessage( sqlError );
{ end if }
end; { with TheQuery }

tks,

jwc