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;