Connection to a remote sql server 
Author Message
 Connection to a remote sql server

Hi all,

I am trying to connect to a remote database over the LAN.  The error that I
get is #3706 which is a problem with the 'provider'. Any idea why?  The SQL
server is running but I can't seem to connect.  What am I doing wrong?

The code that I am using is: -

SQLConn = "Provider=SQLOLEDB;Data Source=;Initial Catalog=;User
Id=;Password=;"
objConnection.Open SQLConn
If Err.Number <> 0 Then
    MsgBox "Unable to establish connection.  " & _
    "Database: Error#" & Err.Number & "- " & _
    Err.Description, vbCritical
    Exit Sub
Else
    MsgBox "Connection established"
End If

or

objConnection.ConnectionString = "Provider=SQLOLEDB;Data Source=;Initial
Catalog=;User
Id=;Password=;"
objConnection.Open
If Err.Number <> 0 Then
    MsgBox "Unable to establish connection.  " & _
    "Database: Error#" & Err.Number & "- " & _
    Err.Description, vbCritical
    Exit Sub
Else
    MsgBox "Connection established"
End If

Help?

Thanx
Nish



Tue, 20 Jan 2004 21:33:39 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. IMPORTANT ado connection to remote sql server v.7

2. IMPORTANT ado connection to remote sql server v.7

3. Connection to remote SQL Server database?

4. ADO connection to remote SQL-Server database refused

5. SQL Server 2008 remote connection fails

6. Remote Ole Server Over remote access connection

7. MS SQL connection string for remote internet connection?

8. Import xls file into SQL Server using VBscript and exe function on remote server

9. Need Connection string for VB6 DAO DSN-LESS Connections to SQL Server 2000

10. Need Connection string for VB6 DAO DSN-LESS Connections to SQL Server 2000

11. SQL Server connections not closing when Access connection also open

12. Remote SQL Connection in Access

 

 
Powered by phpBB® Forum Software