Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Whats Wrong With This ? (ADO Question)

Status
Not open for further replies.

Grudge

Programmer
Jul 30, 2002
23
0
0
ZA
I'm trying to create the TADOConnection at runtime, with the following code :

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 ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top