Page 1 of 1

invalid database handle

Posted: Mon 30 Aug 2010 08:36
by jalmalier_aja
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;

Posted: Mon 30 Aug 2010 09:35
by Dimon
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.