Run-time error 3706 Provider cannot be found

nightheart

New Member
Joined
Feb 9, 2012
Messages
10
Hi,

I'm running Windows 7 64 bit and Office 2010 32 bit. I'm trying to run an access query from excel using VBA but i got the above mentioned error at the highlighted step.
Code:
Dim cn As ADODB.Connection
Dim strName As String
Dim strSQL As String
Dim strConnection As String
Dim rs As ADODB.Recordset


Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset


strName = Application.InputBox("Please enter the file location....", "File path")


With cn
.Provider = "Provider=Microsoft.ACE.OLEDB.12.0"
.ConnectionString = "Data Source=" & strName & " ;"
[COLOR=#ff0000].Open[/COLOR]
End With

Would you please help me with that error. Thanks
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I think that should be:
Rich (BB code):
.Provider = "Microsoft.ACE.OLEDB.12.0"

rather than
Rich (BB code):
Rich (BB code):
.Provider = "Provider=Microsoft.ACE.OLEDB.12.0"
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,638
Members
449,093
Latest member
Ahmad123098

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