Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread elevateDB OnQueryError or OnScript Error Event Like dbIsam
Wed, Jan 19 2011 6:35 PMPermanent Link

George

I would like to trap SQL or Script Error inside a  Try-Except-End block.  I
usually do this in dbIsam by looking at the e.message when the dbIsam
OnQuery error fires up in the Exception handling block.  Is there an
equivalent event OnQueryError or OnScriptError for Elevatedb?

Thanks,
George Patena

Wed, Jan 19 2011 6:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

George,

<< I would like to trap SQL or Script Error inside a  Try-Except-End block.
I usually do this in dbIsam by looking at the e.message when the dbIsam
OnQuery error fires up in the Exception handling block.  Is there an
equivalent event OnQueryError or OnScriptError for Elevatedb? >>

Just wrap the query or script execution in a try..except block and use the
except block to trap for any errors:

try
   MyQuery.ExecSQL;
except
   on E: Exception do
       begin
       if (E is EEDBError) then
           //  Handle EDBError here
       else
           raise
       end;
end;

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, Jan 19 2011 7:10 PMPermanent Link

George

<< try
   MyQuery.ExecSQL;
except
   on E: Exception do
       begin
       if (E is EEDBError) then
           //  Handle EDBError here
       else
           raise
       end;
end>>


Very useful and applicable to other types of error handling (other than  E
is EEDBError).

Thanks Tim,
George Patena

Image