SQL Error

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Cogito
Posts: 24
Joined: Sat 05 Jul 2008 07:15

SQL Error

Post by Cogito » Fri 22 Jan 2010 12:34

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!

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 26 Jan 2010 08:45

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;

Post Reply