Nando
2008-03-12 14:59:38 UTC
Hi all,
I'm trying to create a connection at run time but it is not working.
This is the code
Connection:= TSQLConnection.Create(nil);
Connection.ConnectionName := 'myConnection';
Connection.DriverName := 'MSSQL';
Connection.LibraryName := 'dbxmss30.dll';
Connection.VendorLib := 'oledb';
Connection.GetDriverFunc := 'getSQLDriverMSSQL';
Connection.Params.Add('drivername=MSSQL');
Connection.Params.Add('schemaoverride=%.dbo');
Connection.Params.Add('hostname=myServer');
Connection.Params.Add('database=myDatabase');
Connection.Params.Add('user_name=myUser');
Connection.Params.Add('password=myPassword');
Connection.Params.Add('blobsize=-1');
Connection.Params.Add('localecode=0000');
Connection.Params.Add('mssql transisolation=ReadCommited');
Connection.Params.Add('os authentication=False');
Connection.Params.Add('prepare sql=False');
Connection.LoginPrompt:= False;
Connection.Open; -->> SQL State: HYT00, SQL Error Code:0 Time out error.
If I create the connection at desing time with the same properties and
parameters it works fine.
What am I doing wrong?
Thank you in advance for any help.
Nando
I'm trying to create a connection at run time but it is not working.
This is the code
Connection:= TSQLConnection.Create(nil);
Connection.ConnectionName := 'myConnection';
Connection.DriverName := 'MSSQL';
Connection.LibraryName := 'dbxmss30.dll';
Connection.VendorLib := 'oledb';
Connection.GetDriverFunc := 'getSQLDriverMSSQL';
Connection.Params.Add('drivername=MSSQL');
Connection.Params.Add('schemaoverride=%.dbo');
Connection.Params.Add('hostname=myServer');
Connection.Params.Add('database=myDatabase');
Connection.Params.Add('user_name=myUser');
Connection.Params.Add('password=myPassword');
Connection.Params.Add('blobsize=-1');
Connection.Params.Add('localecode=0000');
Connection.Params.Add('mssql transisolation=ReadCommited');
Connection.Params.Add('os authentication=False');
Connection.Params.Add('prepare sql=False');
Connection.LoginPrompt:= False;
Connection.Open; -->> SQL State: HYT00, SQL Error Code:0 Time out error.
If I create the connection at desing time with the same properties and
parameters it works fine.
What am I doing wrong?
Thank you in advance for any help.
Nando