Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: SQLOLEDB Connection


Message #1 by "Gladys McPherson" <gcm@h...> on Wed, 26 Sep 2001 10:57:22
HI 

I am new to SQL Server and am writing a program in VB6 which will connect 
to SQL 2000 database remotely. I have been browsing the archives and tried 
using the following code for the connection:

 cnn1.ConnectionString = "Provider=SQLOLEDB;" & _
                   "Data Source=xxx.xxx.xxx.xxx,1433;" & _
                   "Network Library=DBNETLIB;" & _
                   "Initial Catalog=my_database;" & _
                   "User ID=txtName;" & _
                   "Password=txtPassword;"
  cnn1.Open

IP address of SQL Server where the xxx's are.

DNETLIB is the library associated with TCP/IP on my client network 
utility. I have also tried it with DBMSSOCN.

The error message I get is:
Run-time error -214217843 (80040e4d)
Method 'Open' of object'_Connection' failed

Do I have to set up a user account with permissions to log in through a 
dial-up connection? How do I do that? Must I make sure the Server has a 
modem and it's configured properly?

Cheers


  Return to Index