• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1813
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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