EOraError.Sender is nil
Posted: Mon 23 Apr 2007 23:21
Hi,
how can it happen, that the EOraError.Sender Property is nil, when an exception is raised?
I want to use/show the sql-statement of the EOraError, but the property is nil when the exception raises.
I',m using 6.0.0.6
My MadExcept Exception Handler looks like the following:
Any ideas?
Greetings
Jens
how can it happen, that the EOraError.Sender Property is nil, when an exception is raised?
I want to use/show the sql-statement of the EOraError, but the property is nil when the exception raises.
I',m using 6.0.0.6
My MadExcept Exception Handler looks like the following:
Code: Select all
procedure OdacExceptHandler(const exception : IMEException;
var handled : boolean);
begin
if Assigned(Exception.ExceptObject) then
if Exception.ExceptObject is EOraError then
if Assigned(EOraError(Exception.ExceptObject).Sender) then
if EOraError(Exception.ExceptObject).Sender is TCustomDADataSet then
exception.BugReportSections.Contents['SQL-Statement'] :=
TCustomDADataSet(EOraError(Exception.ExceptObject).Sender).FinalSQL
else if EOraError(Exception.ExceptObject).Sender is TCustomDASQL then
exception.BugReportSections.Contents['SQL-Statement'] :=
TCustomDASQL(EOraError(Exception.ExceptObject).Sender).FinalSQL;
end;
initialization
RegisterExceptionHandler(OdacExceptHandler, stTrySyncCallOnSuccess, epPostProcessing);Any ideas?
Greetings
Jens