Page 1 of 1

Error code/error message from TZConnection with Postgres

Posted: 21.06.2011, 11:33
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

Posted: 21.06.2011, 14:37
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

Posted: 23.06.2011, 12:06
by ccezar
Thank you Wild_Pointer! :)