Disable showing error message for script

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Tarifer
Posts: 21
Joined: Thu 26 May 2011 08:13

Disable showing error message for script

Post by Tarifer » Fri 24 Aug 2012 10:10

Hello! I use LiteScript.
Now if error occured, then it trigger OnError event, but then show error message on screen.
I use it in windows service, and need disable showing error message.

How can I do it?

I need this in SDAC and ODAC too.

Thanks,
Dmitry Ukolov.

Tarifer
Posts: 21
Joined: Thu 26 May 2011 08:13

Re: Disable showing error message for script

Post by Tarifer » Sat 25 Aug 2012 14:54

Make it as:

Code: Select all

for i := 0 to ScriptRunner.Statements.Count-1 do
begin
  Statement := ScriptRunner.Statements[i];
  try
    Execute(Statement.SQL, EmptyParam);
  except
    on E : Exception do
      FScriptErrors.Add(E.Message + #13#10 + 'SQL: '+Statement.SQL+#13#10);
  end;
end;
Is it correct?

ZEuS
Devart Team
Posts: 236
Joined: Thu 05 Apr 2012 07:32

Re: Disable showing error message for script

Post by ZEuS » Mon 27 Aug 2012 07:30

In order to avoid showing error messages, you should set the Action parameter in the LiteScript.OnError event handler to eaContinue if you want to continue script execution, or to eaAbort if you want to abort script execution. In both these cases, no error message will be displayed.
Please, refer to the help topic for the TErrorAction enumeration in the LiteDAC documentation to learn more about possible Action values.

Tarifer
Posts: 21
Joined: Thu 26 May 2011 08:13

Re: Disable showing error message for script

Post by Tarifer » Tue 28 Aug 2012 07:56

Thanks!

Post Reply