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.
TORAQuery exceptions
Re: TORAQuery exceptions
Hello,
The EOraError(e).Component property points to the object, in which the error has occurred on the OnError event:
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;
-
- Posts: 5
- Joined: Wed 21 Jul 2010 14:50
Re: TORAQuery exceptions
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.
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.
Re: TORAQuery exceptions
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.