I know there are a number of threads related to this. However, none of them seemed to solve my problem. I am putting down my exact problem here. Can someone help me with this?
Environment - Windows 7 64 bit, Office 2013 64 bit
Automation - A macro in VBA in Excel that will import some data to an .mdb file by connecting to it using the below mentioned driver
Issue - Runtime error 3706, provider cannot be found. it may not be properly installed
Attempt 1 - I checked the error code online and most of the threads pointed to syntax errors and way of connecting. I tried implementing the suggestions but there was no impact
Attempt 2 - I then found that this is because it was trying to use old driver with 64 bit office. Therefore, I then tried installing the most popular suggestion - http://www.microsoft.com/en-us/download/details.aspx?id=13255 This also didn't work
Code -
database_path = Application.ActiveWorkbook.path & "\" & "mydb.mdb"
Set cn = CreateObject("ADODB.Connection")
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=" & database_path
End With
cn.Open
Any solution is welcome as long as it works on all - office 2007, 2010 and 2013.
Thanks!