Page 1 of 1

Disable showing error message for script

Posted: Fri 24 Aug 2012 10:10
by Tarifer
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.

Re: Disable showing error message for script

Posted: Sat 25 Aug 2012 14:54
by Tarifer
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?

Re: Disable showing error message for script

Posted: Mon 27 Aug 2012 07:30
by ZEuS
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.

Re: Disable showing error message for script

Posted: Tue 28 Aug 2012 07:56
by Tarifer
Thanks!