trick for catching database errors lazarus / 16-Databases ---------------------------------------------------------------------- 3rdshiftcoder · 2020-12-25 09:46 HI all- I am wondering how to catch a more specific database error. I am trying to use firebird but NOT zeos controls. Imagine if I had put an error in my sql property in the editor on purpose. This code works,  but I need the trick to catch db errors.Thanks robo-loki Here is a sample of the code I run but it is not database specific. I run it with Run->RunWithoutDebugging:  DataModule3.SQLQuery3.Close;     try     // Do something that might go wrong.     DataModule3.SQLQuery3.Open;   except on  E:EXCEPTION do     begin       // Try to recover or show the user an error message.         exit;     end;   end; ---------------------------------------------------------------------- 3rdshiftcoder · 2020-12-25 10:24 Hi all- This link looks promising. Thanks for posting it. robo-loki https://forum.lazarus.freepascal.org/index.php/topic,38600.msg263018.h tml#msg263018