tconingford
asked on
Runtime Error '3706' VBA/SQL Server Error
I'm getting a runtime error '3706' Provider Cannot be found It may be improperly installed,
Attempting to connect to update a SQL Server database from a VB app in excel, heres the code:
Sub Open_INSQL()
Dim SQLConn As ADODB.Connection
Dim strConn As String
' Assign the connection string to a variable.
strConn = "DRIVER={SQL Server};SERVER=EBHPRMML350 ;UID=sa;PW D=;DATABAS E=Runtime; "
' Create the Connection object.
Set SQLConn = New ADODB.Connection
'Assign the connection string and provider, then open the connection.
With SQLConn
.ConnectionString = strConn
.Provider = "MSSQL"
' Valid Enums for the ADO Prompt property are:
'adPromptAlways = 1
'.Properties("Prompt") = adPromptAlways
SQLConn.Open strConn
End With
Attempting to connect to update a SQL Server database from a VB app in excel, heres the code:
Sub Open_INSQL()
Dim SQLConn As ADODB.Connection
Dim strConn As String
' Assign the connection string to a variable.
strConn = "DRIVER={SQL Server};SERVER=EBHPRMML350
' Create the Connection object.
Set SQLConn = New ADODB.Connection
'Assign the connection string and provider, then open the connection.
With SQLConn
.ConnectionString = strConn
.Provider = "MSSQL"
' Valid Enums for the ADO Prompt property are:
'adPromptAlways = 1
'.Properties("Prompt") = adPromptAlways
SQLConn.Open strConn
End With
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForSQLServer
Leon