Subject [IBO] SQL Error Trapping
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






Yahoo! Groups Sponsor

<http://rd.yahoo.com/M=251812.3170658.4537139.1261774/D=egroupweb/S=17050071
83:HM/A=1564416/R=0/SIG=11ti81skc/*http://www.netflix.com/Default?mqso=60164
797&partid=3170658>


___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .


[Non-text portions of this message have been removed]