I?m using Zeos with Lazarus and Firebird.
When I needed to execute an INSERT, UPDATE or DELETE sentence, I usually used a ZQuery component, with the ExecSQL method.
As in this code portion: (sQ variable contains mi SQL sentence).
Result := True;
on E:Exception do
Result := False;
ShowMessage('An error occurs: '+E.Message);
Now I'm trying to use ZConnection.ExecuteDirect instead ZQuery.ExecSQL. It looks simplier.
But the problem I find is this: when the sql sentence was not succesful (syntax error, or PK duplicates o something else), I don't know how to capture the error to show the error message.
I mean: the ExecuteDirect returns False, but I think no exception is thrown. Is this correct? So, where can I find the error message returned? is this possible?
Forum related to Firebird
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest