Dietmar Brueckmann
07-Sep-2005, 02:16 PM
Hi,
I've asked this question some times ago. And the answer was version 5 would
get the feature.
My problem:
In case of an SQL-error I'm using my own dialog (TfoSqlFehler or a
descendant) for easy getting the used SQL.
The dialog shows the error-message and the used SQL + SQL with inserted
parameter-values if it is a parametrized query.
______________________________________________
TSqlFehlerBehandeln = class(TEurekaLog)
procedure TSqlFehlerBehandeln.aOnException(Sender: TObject; E: Exception);
var
foSqlFehler : TfoSqlFehler;
begin
if (E is EStdSql) and (SqlFehlerFormularClass <> nil) then begin
foSqlFehler := SqlFehlerFormularClass.Create(nil);
try
foSqlFehler.ExceptionBehandeln(EStdSql(E));
finally
FreeAndNil(foSqlFehler);
end;
end;
end;
procedure TSqlFehlerBehandeln.SFB_ExceptionNotify(
EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean);
begin
inherited;
Handled := not (EurekaExceptionRecord.ExceptionObject is EStdSql);
end;
procedure TSqlFehlerBehandeln.SFB_ExceptionActionNotify(
EurekaExceptionRecord: TEurekaExceptionRecord;
EurekaAction: TEurekaActionType; var Execute: Boolean);
begin
inherited;
case EurekaAction of
atShowingExceptionInfo: if EurekaExceptionRecord.ExceptionObject is
EStdSql
then Execute := False;
end;
end;
constructor TSqlFehlerBehandeln.Create(AOwner: TComponent);
begin
inherited;
Application.OnException := aOnException;
OnExceptionNotify := SFB_ExceptionNotify;
OnExceptionActionNotify := SFB_ExceptionActionNotify;
end;
______________________________________________
an unimported question: I don't know, where I found the basics to the code
above. Is there a tutorial I don't know.
the really question:
I'd like to integrate my informations into the Euraklog-dialog.
1. to add the SQL-informations to the log-file
2. to prevent showing large SQL-statements beneath the important
error-message. The users are confused in seeing long error messages. The
information should only be visible after pressing "Details", like Eurekalog
does.
In the help I can see a Tabsheet of the Eurekalog-dialog named "other".
If I could use it, it would help. But how to use - I did'nt find any
information not in .chm nor in the .pas of the source or demo-files.
It would be fine to use a descendant of the original-Eurekalog-dialog (for
changing "Other" to "SQL" - but that#s not necessary.
--
Best regards
Dietmar Brueckmann
I've asked this question some times ago. And the answer was version 5 would
get the feature.
My problem:
In case of an SQL-error I'm using my own dialog (TfoSqlFehler or a
descendant) for easy getting the used SQL.
The dialog shows the error-message and the used SQL + SQL with inserted
parameter-values if it is a parametrized query.
______________________________________________
TSqlFehlerBehandeln = class(TEurekaLog)
procedure TSqlFehlerBehandeln.aOnException(Sender: TObject; E: Exception);
var
foSqlFehler : TfoSqlFehler;
begin
if (E is EStdSql) and (SqlFehlerFormularClass <> nil) then begin
foSqlFehler := SqlFehlerFormularClass.Create(nil);
try
foSqlFehler.ExceptionBehandeln(EStdSql(E));
finally
FreeAndNil(foSqlFehler);
end;
end;
end;
procedure TSqlFehlerBehandeln.SFB_ExceptionNotify(
EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean);
begin
inherited;
Handled := not (EurekaExceptionRecord.ExceptionObject is EStdSql);
end;
procedure TSqlFehlerBehandeln.SFB_ExceptionActionNotify(
EurekaExceptionRecord: TEurekaExceptionRecord;
EurekaAction: TEurekaActionType; var Execute: Boolean);
begin
inherited;
case EurekaAction of
atShowingExceptionInfo: if EurekaExceptionRecord.ExceptionObject is
EStdSql
then Execute := False;
end;
end;
constructor TSqlFehlerBehandeln.Create(AOwner: TComponent);
begin
inherited;
Application.OnException := aOnException;
OnExceptionNotify := SFB_ExceptionNotify;
OnExceptionActionNotify := SFB_ExceptionActionNotify;
end;
______________________________________________
an unimported question: I don't know, where I found the basics to the code
above. Is there a tutorial I don't know.
the really question:
I'd like to integrate my informations into the Euraklog-dialog.
1. to add the SQL-informations to the log-file
2. to prevent showing large SQL-statements beneath the important
error-message. The users are confused in seeing long error messages. The
information should only be visible after pressing "Details", like Eurekalog
does.
In the help I can see a Tabsheet of the Eurekalog-dialog named "other".
If I could use it, it would help. But how to use - I did'nt find any
information not in .chm nor in the .pas of the source or demo-files.
It would be fine to use a descendant of the original-Eurekalog-dialog (for
changing "Other" to "SQL" - but that#s not necessary.
--
Best regards
Dietmar Brueckmann