TSmartQuery : Supress Exception

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
OzDelphiFan
Posts: 2
Joined: Wed 27 Jun 2007 13:44

TSmartQuery : Supress Exception

Post by OzDelphiFan » Wed 27 Jun 2007 14:01

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;

====================================

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Wed 27 Jun 2007 14:32

We couldn't reproduce this error using information you have specified. Please send to ODAC support address complete sample that demonstrates this problem.

OzDelphiFan
Posts: 2
Joined: Wed 27 Jun 2007 13:44

Post by OzDelphiFan » Thu 28 Jun 2007 02:04

Thanks

Ill try it again after I purchase the full version. If it doesnt work, Ill send it to support.

Post Reply