How to test if a TConnection is active before trying to read data. lazarus / 16-Databases ---------------------------------------------------------------------- vfclists · 2010-07-12 10:37 Is there a way of testing when a TZConnection is active when the network is down? The TZConnection.Connected property is true even when the network connection is down, and it doesn't seem to change when an attempt to connect to the database fails. Isn't there a way of monitoring the TZConnection rather than trying to open a table and realizing that the connection is down? Is there also a way of trapping the exception when you try to open the table when there is no connection? I try testing for E:EZSQLException but it doesn't seem to catch everything. ---------------------------------------------------------------------- Mujie · 2010-07-25 16:00 Why do not you use simple logic "if else" condition ? Code: [Select]if succeed then begin   //your code else begin   //terminated end; ---------------------------------------------------------------------- fredycc · 2010-07-26 01:32 Depends of your database engine you can use for example like Mujie suggest before Execute or open datasets: Quote  ZConnection1.Ping               or   ZConnection1.PingServer