I'm trying to create the TADOConnection at runtime, with the following code :
But I get the following error message :
"[DBNETLIB][ConnectionOpen(Connect()).]SQL Server does not exist or access denied"
The server does exists and when I use a TADOConnection placed on the form at runtime, using the exact same connectionstrint\g, then it works fine. Any ideas ?
Code:
// the connection
TADOConnection *Test;
Test = new TADOConnection(NULL);
// specify the connections string
Test->ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=localMO;Data Source=SCEPC\SQLDEV";
// open it
Test->Open();
ShowMessage( "Succesfully Connected to Database" );
Test->Close();
But I get the following error message :
"[DBNETLIB][ConnectionOpen(Connect()).]SQL Server does not exist or access denied"
The server does exists and when I use a TADOConnection placed on the form at runtime, using the exact same connectionstrint\g, then it works fine. Any ideas ?