Runtime Error '3706' VBA/SQL Server Error

Posted on 2006-03-30
Last Modified: 2013-12-25
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
Question by:tconingford
    LVL 75

    Accepted Solution

    You don't need the following line:
           .Provider = "MSSQL"

    But if you insist the correct name for the ODBC provider is : MSDASQL
    LVL 29

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now