I am having problem with EXCEPT and FINALLY code not executing after calling TSMARTQUERY.OPEN with an invalid SELECT statement
When running from the Delphi 6 IDE - when I call SmartQuery.OPEN the following error appears
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Project MYPROJECT.exe raised exception class EOraError with message 'ORA-00942: table or view does not exist
'. Process stopped. Use Step or Run to continue.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Then - my function exits and the FINALLY and EXCEPT sections in the function are bvpassed / stepped into as they are supposed to
If I run from outside of the IDE, the program immediately closes and no errors appear.
I am using Delphi 6 and the trial version of ODAC (I am planning to purchase a licensed version next week)
my code is similar to the following.
Thanks very much for any assistance that you can offer
====================================
var vQuery : TSmartQuery;
begin
vQuery := TSmartQuery.Create(nil);
vQuery.Session := MySession;
try
try
vQuery.SQL.clear;
vQuery.SQL.append ('SELECT THIS IS AN INVALID QUERY');
vQuery.Open; -- (#1)
ShowMessage (vQuery.FieldByName('MY_TEST_COLUMN').text);
except on E: Exception do
ShowMessage ('This is the EXCEPTION HANDLER');
end;
finally
ShowMessage ('This is the FINALLY');
vQuery.Free;
end;
end;
====================================
TSmartQuery : Supress Exception
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
-
OzDelphiFan
- Posts: 2
- Joined: Wed 27 Jun 2007 13:44