Results 1 to 23 of 23

Provider Cannot be found

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-19-2015
    Location
    Karnataka, INdia
    MS-Off Ver
    MS Office 2010
    Posts
    277

    Provider Cannot be found

    Hi,

    I am not sure where i am going wrong but everytime i run this code it gives me an Run time Error 3706: Provider Could not be Found. I have checked Activex Data Object 2.8 Reference.

    Sub a()
    Dim cn As Object
    Dim rs As Object
    Dim strFile As String
    Dim strCon As String
    Dim strSQL As String
    Dim s As String
    Dim i As Integer, j As Integer
    
    ''Access database
    
    strFile = "Application.Thisworkbook.path\Database.accdb"
    
    strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strFile & ";"
    
    Set cn = CreateObject("ADODB.Connection")
    Set rs = CreateObject("ADODB.Recordset")
    
    cn.Open strCon
    
    'Rough idea
    intMonth = Sheet1.[H2]
    intYear = Sheet1.[H3]
    
    
    strSQL = "SELECT * " _
           & "FROM qryMonthlyValuesSingleLine " _
           & "WHERE [Enter Month Name] = " & intMonth _
           & " AND WHERE [Enter Year Name] = " & intYear
           
    rs.Open strSQL, cn, 3, 3
    
    Worksheets("Sheet2").Cells(2, 1).CopyFromRecordset rs
    
    ''Tidy up
    rs.Close
    Set rs = Nothing
    cn.Close
    Set cn = Nothing
    End Sub
    Last edited by Biplab1985; 03-05-2017 at 08:19 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Provider Not Found
    By sawoodalam1989 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2013, 01:52 AM
  2. Run time "3706" Provider cannot be found. It may not be properrly installed
    By worrall in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-02-2012, 10:41 AM
  3. Add columns to excel using OLEDB provider
    By Umamageswari in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-07-2010, 08:19 AM
  4. Find the cheepest provider in a table
    By ElmerS in forum Excel General
    Replies: 6
    Last Post: 06-16-2009, 08:14 AM
  5. VBA for Excel service provider(s)
    By gabch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2006, 10:11 PM
  6. [SOLVED] OLE DB Provider and Excel
    By David Mullins in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2006, 03:55 PM
  7. What Is The Right Provider?
    By Jim Heavey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-06-2006, 02:25 PM
  8. check for OLE DB provider?
    By cesw in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2005, 07:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1