Page 1 of 1

EDatabaseError not raised

Posted: Wed 29 Jun 2016 13:24
by LHSoft
Hello,
I tried to open a table where one field missing in table of Database.
Data.DB correctly raises the EDatabaseError in

Code: Select all

procedure DatabaseError(const Message: string; Component: TComponent = nil);
but this error does not arrive in your TLiteConnection.onError.

Shouldn't be that handled in OnError of TLiteConnection?

best regards
Hans

Re: EDatabaseError not raised

Posted: Thu 30 Jun 2016 12:32
by AlexP
Hello,

If the number of fields or their types don't match, then the error is generated not by the database, but by Delphi using a usual method Raise. Therefore the onError event doesn't occur, since it works with errors generated by the database. If you need to handle this error, you can use a try...except block.