Amigos, aún sigo sin poder resolver este tema.
Estoy intentando con una función que ejecuta un procedimiento en el servidor, que en caso de lograr ejecutar entrega un TRUE, y en caso contratio, intente cerrar y abriendo nuevamente la conección.
Adjunto código.
Código Delphi
[-]
function TMainForm.estado_coneccion(Sender: TObject): boolean;
var General : TDSGeneralClient;
int: integer;
begin
try
if ClientModule1.SQLConnection1.DBXConnection <> nil then
General := TDSGeneralClient.Create(ClientModule1.SQLConnection1.DBXConnection);
if not ClientModule1.SQLConnection1.Connected then
ClientModule1.SQLConnection1.open;
result := General.OK;
if assigned(General) then
general.free;
except
if assigned(General) then
general.free;
try
result := false;
ClientModule1.SQLConnection1.close;
ClientModule1.SQLConnection1.open;
result := true;
except
showmessage('Error al conectarse con el servidor');
end;
end;
end;
Esto funciona con algunos errores, una vez corriendo el cliente y apago el servidor, me arroja errores al intentar dejar libre la variable General.
Alguien me puede guiar para poder resolver este misterio !!!