捕捉TZConnection断线异常
try
qry.Close;
qry.open;
except
on e: exception do
if (e is EZSQLException) and (e.message = 'DBError : [20006] : Write to the server failed') then
begin
ZConnection1.Reconnect;
end;
end;