Error code/error message from TZConnection with Postgres

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

ccezar
Fresh Boarder
Fresh Boarder
Posts: 22
Joined: 19.06.2007, 18:07

Error code/error message from TZConnection with Postgres

Postby ccezar » 21.06.2011, 11:33

Hello,

I'm connecting to Postgres 8.4 database which sometimes is unavailable. I've no problem with servicing such a situation with 'try ... .finally' however I'm unable to find TZConection's property which hold potential error number or error message (like pg_last_error or pg_result_error in PHP). Where shoudl I search?

regards,

Cezar

Wild_Pointer
Expert Boarder
Expert Boarder
Posts: 162
Joined: 18.03.2008, 13:03
Contact:

Postby Wild_Pointer » 21.06.2011, 14:37

Hello ccezar,

You should use try... except instead of try finally

Code: Select all

try
  ZConnection1.Connect;
except
  On E:Exception do
  Begin
    ShowMessage(E.Message);
  End;
end;


Good luck

ccezar
Fresh Boarder
Fresh Boarder
Posts: 22
Joined: 19.06.2007, 18:07

Postby ccezar » 23.06.2011, 12:06

Thank you Wild_Pointer! :)


Return to “PostgreSQL”

Who is online

Users browsing this forum: No registered users and 1 guest