Postgresql lazarus / 16-Databases ---------------------------------------------------------------------- Miflon · 2020-01-07 17:23 Happy new year, everybody. Again I need your help. In my application (Windows 10, Lazarus 2.0.6, Postgresql 11.6, Zeos 7.2.6.1), querying, inserting and updating fields work fine. Now I would like catching potential errors done by users, such as unique violation (23505), not null violation (23502) and so on. I use this code from https://forum.lazarus.freepascal.org/index.php?topic=18499.0:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i try       SQLQuery1.ExecSQL;    except      on E: Exception do        if E is EPQDatabaseError then          Showmessage((E as EPQDatabaseError).SQLSTATE);    end;to fetch the error code (23505 ...). This code snippet raises an error while compiling: "Identifiier not found EPQDatabaseError". I searched in Lazarus and Zeos directories without success. Where can I find EPQDatabaseError? Thanks for your help, Michel. ---------------------------------------------------------------------- winni · 2020-01-07 17:35 Hi! Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i cd  /MyPath/to/fpcsrc grep -ir EPQDatabaseError *  gives the result: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 3.0.4/packages/fcl-db/src/sqldb/postgres/pqconnection.pp Winni ---------------------------------------------------------------------- Miflon · 2020-01-07 20:21 Thanks for the help, winni. I find it even though path is not exactly the same in W10, on my install, and Linux. Michel. ---------------------------------------------------------------------- valdir.marcos · 2020-01-07 21:36 Quote from: Miflon on January 07, 2020, 06:23:11 pmHappy new year, everybody. Again I need your help. In my application (Windows 10, Lazarus 2.0.6, Postgresql 11.6, Zeos 7.2.6.1), querying, inserting and updating fields work fine. Now I would like catching potential errors done by users, such as unique violation (23505), not null violation (23502) and so on. I use this code from https://forum.lazarus.freepascal.org/index.php?topic=18499.0:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i try       SQLQuery1.ExecSQL;    except      on E: Exception do        if E is EPQDatabaseError then          Showmessage((E as EPQDatabaseError).SQLSTATE);    end;to fetch the error code (23505 ...). This code snippet raises an error while compiling: "Identifiier not found EPQDatabaseError". I searched in Lazarus and Zeos directories without success. Where can I find EPQDatabaseError? Thanks for your help, Michel.Just add PQConnection to your user list: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  ..., PQConnection;