invalid database handle

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jalmalier_aja
Posts: 2
Joined: Thu 12 Aug 2010 03:29

invalid database handle

Post by jalmalier_aja » Mon 30 Aug 2010 08:36

invalid database handle



i have a trouble when i try to connect to wrong database path and try to connect to right database path
the trouble is like this

first i try to connect to right database path it was success and i can open the tibcquery
then i try to connect to wrong database path and it was right raise and a error if the database path is invalid
then i try to connect again to right database path the connection result is success but when i open the tibcquery it raise an error

invalid database handle(no active connection).
but the result of my function is connected=true;


function doConnect(ASERVERDATASET: TIBCConnection; ServerName,
DatabasePath: string): boolean;
begin
Result := false;
ASERVERDATASET.Disconnect;
try
ASERVERDATASET.Username := MY_USERNAME;
ASERVERDATASET.Password := MY_PASS;
ASERVERDATASET.Options.Protocol := TCP;
ASERVERDATASET.Server := ServerName;
ASERVERDATASET.Database := DatabasePath;
ASERVERDATASET.Connect;
Result := ASERVERDATASET.Connected;
except

end;

end;

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 30 Aug 2010 09:35

I can not reproduce the problem.
Please check that TIBCQuery has the Connection property set in both cases.
Also send me a complete small sample to dmitryg*devart*com to demonstrate the problem.

Post Reply