Error code/error message from TZConnection with Postgres

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

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

Error code/error message from TZConnection with Postgres

Post by ccezar »

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: 164
Joined: 18.03.2008, 13:03
Contact:

Post by Wild_Pointer »

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

Post by ccezar »

Thank you Wild_Pointer! :)
Post Reply