Check Connection to Firebird

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
fredycc
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: 18.01.2010, 16:48

Check Connection to Firebird

Post 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. :(
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

Have you tried using method ZConnection.Pingserver?
fredycc
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: 18.01.2010, 16:48

Post by fredycc »

Thanks seawolf, works perfect for firebird connection!
Post Reply