Link to home
Start Free TrialLog in
Avatar of tconingford
tconingfordFlag for United States of America

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;PWD=;DATABASE=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
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial