判断数据库时时连接程序,判断是否断开,断开则自动连接
try
with ADOQuery_temp do
begin
Close;
SQL.Clear;
SQL.Add('select top 1 id from y_users ');
Open;
end;
except
Frm_Data.ADOConnection1.Connected:=False;
Frm_Data.ADOConnection1.Connected:=True;
end;