Run-time error 3706 - Provider not found

BarryStevenson

New Member
Joined
Dec 31, 2008
Messages
1
Hi Guys,
I am building an application for Excel 2003 which pulls data from an Access 2007 database using an ADO connection. I have successfully tested this using Excel 2007 in 2003 compatibility mode using :
strPathName = ThisWorkbook.Path
MyConn = strPathName & "\Test.accdb"
Set cnn = New ADODB.Connection
With cnn
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Open MyConn
End With

When I try running this using Excel 2003, I get the following error message:
Run-time error 3706
Provider cannot be found. It may not be properly installed.

I checked the VBA Project references, it references Microsoft ActiveX Data Objects 2.8 Library.
Does anyone have any ideas?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi Barry and welcome to the Forum. Hi Jan to.

Are you trying to draw data into the excel if so then you could look at using the workbook.opendatabase method, you don't need to then consider the ADO or DAO options. Take a look at this simple snippet of code to see if it helps. Forgot to say that they Help file will give you an example which pulls in data from a query Highlight the OpenDatabase and press F1

Code:
Sub connectDB()
'This method is connecting to a database without referencing to ADO or DAO
Workbooks.OpenDatabase "C:\Access VBA Practice\02Contac.mdb"
 
End Sub
 
Upvote 0
Hi Trevor,

Thanks for your tip - it will be useful when I shall read the complete table into Excel. But in this case I need to use some SQL to filter the data. So I guess I have to use ADO or DAO here..?

Regards
Jan Erik
 
Upvote 0
OK try this out I have tested this and it works fine to open a database if you need to run other things then let me know and I will see if I can assist.

Sub dbconnect1()
Dim acApp As Object
Set acApp = CreateObject("Access.Application")
acApp.OpenCurrentDatabase ("C:\Access VBA Practice\02Contac.mdb")
acApp.Visible = True
Set acApp = Nothing

End Sub
 
Upvote 0
Thanks again. In the mean time I've discovered that the problem occured just in MS Excel 2010 64byte version. In 2003 and 2007 it works fine. But I appreciate your kind help anyway:-)

Jan Erik
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top