• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1736
  • Last Modified:

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
0
tconingford
Asked:
tconingford
1 Solution
 
Anthony PerkinsCommented:
You don't need the following line:
       .Provider = "MSSQL"

But if you insist the correct name for the ODBC provider is : MSDASQL
0
 
leonstrykerCommented:
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now