Page 1 of 1

SQL Error

Posted: Fri 22 Jan 2010 12:34
by Cogito
Hello,

I use a TUniQuery component and assign a sql select statement to the UniQuery.SQL property. So far so good, but what if the sql statement is wrong, is there an exception thrown (if yes how can I get the error message?) or is there an event to handle? I want to avoid that a default dialog appears...

Thanks in advance!

Posted: Tue 26 Jan 2010 08:45
by Plash
No exception is raised when you assign SQL text. Exception can be raised when you call Prepare, Execute, or Open.

Code: Select all

try
  UniQuery.Open;
except
  on E: EUniError do
    ShowMessage(E.Message);
end;