TORAQuery exceptions

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ErezHarari
Posts: 5
Joined: Wed 21 Jul 2010 14:50

TORAQuery exceptions

Post by ErezHarari » Tue 19 Jul 2016 07:14

I catch EOraError exceptions (mostly raised by TORAQuery) in
TOraSession.OnError or TApplicationEvents.OnException events
Can i figure out the component that raised the exception?
Remark: The EOraError(E).Component is TOraDataSet but it point to internal data set and i look for the original data set.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TORAQuery exceptions

Post by AlexP » Thu 21 Jul 2016 10:19

Hello,

The EOraError(e).Component property points to the object, in which the error has occurred on the OnError event:

Code: Select all

procedure TForm1.OraSession1Error(Sender: TObject; E: EDAError;
  var Fail: Boolean);
begin
  ShowMessage(EOraError(e).Component.ClassName); //TOraQuery
  ShowMessage(TOraQuery(EOraError(e).Component).Name); //OraQuery1
end;

ErezHarari
Posts: 5
Joined: Wed 21 Jul 2010 14:50

Re: TORAQuery exceptions

Post by ErezHarari » Sun 24 Jul 2016 05:53

Thanks for your reply but in OnEditError handler, exceptions raised by TOraTable.Edit method
has the following attributes

EOraError(e).ErrorCode = 54
EOraError(e).Component.ClassName = 'TOraDataSet'
TOraDataSet(EOraError(e).Component).Name = ''

Note that EOraError(e).Component exists but it is TOraDataSet instead of TOraTable.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TORAQuery exceptions

Post by AlexP » Wed 14 Sep 2016 09:15

Currently, this code will work correctly on errors in a SQL query. We will consider the possibility to add retrieving of "a real" component on errors at editing.

Post Reply