Hola
He hecho la prueba con un form un boton y una BD de Fibplus (Datos) y me ha funcionado correctamente
Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FIBDatabase, pFIBDatabase,Winsock;
type
TForm1 = class(TForm)
Button1: TButton;
datos: TpFIBDatabase;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
function IcmpCreateFile : THandle; stdcall; external 'icmp.dll';
function IcmpSendEcho
(IcmpHandle : THandle; DestinationAddress : integer;
RequestData : Pointer; RequestSize : Smallint;
RequestOptions : pointer;
ReplyBuffer : Pointer;
ReplySize : DWORD;
Timeout : DWORD) : DWORD; stdcall; external 'icmp.dll';
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Handle: Integer;
Buffer: array [0..7] of Cardinal;
begin
Handle := IcmpCreateFile;
if Handle = -1 then Exit; if not LongBool(IcmpSendEcho(Handle, inet_addr(pchar('127.195.1.1')), nil, 0, nil, @Buffer, SizeOf(Buffer),1000)) then
begin
MessageDlg ('Imposible realizar la conexión con la BD', mtError, [mbOK], 0);
CloseHandle(Handle);
Datos.Connected:= False;
end
else
begin
MessageDlg ('Conexión realizada correctamente', mtInformation, [mbOK], 0);
Datos.Connected:= False;
Datos.Connected:= True;
end;
end;
Saludos