Page 1 of 1

Check Connection to Firebird

Posted: 18.01.2010, 17:04
by fredycc
Hello, this is my first topic, I have used Lazarus 0.9.28.2 beta & FPC 2.2.4, and Zeos 6.6.5 Stable versiĆ³n, today I have update it from SVN.

My problem is the next:

Before any query to db I check if I still connected to the server with:

if not db.Connected then
begin
try
db.Reconnect
.
.
end
else begin
qry.Open;
.
.
end;

But once the component connect firt time, I simulate a disconnect it shutdown the db, and the value of connected still true holding connection, pass the condition and when try open this fail whit the error: connection lost to database .....###(gdb unparsed remainer)###.


mmm where I'm wrong. :(

Posted: 18.01.2010, 19:48
by seawolf
Have you tried using method ZConnection.Pingserver?

Posted: 18.01.2010, 23:20
by fredycc
Thanks seawolf, works perfect for firebird connection!