Connection string to ACCESS 2010 From EXCEL 2010 no longer recognizes file
Posted on 2013-12-26
I have been using he below to import data but now it says it does no recognize the file! I am opening ACCESS 2010 table from Excel 2010 with a select query, but now it won't even open the connection. Any suggestions on what I could look for to figure out why it worked and now won't? When I try to open with the Data tab using a query, I also now get unrecognized format, but it all looks fine.
Dim conn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sSQL As String
Dim rng As Range
Dim Wks As Worksheet
Dim strCellAddress As String
Dim rngName As Range
Set conn = New ADODB.Connection
conn.Provider = "Microsoft.ACE.OLEDB.12.0;"
conn.ConnectionString = strDatabasePath
Set rng = ThisWorkbook.Worksheets("ListData").Range("A6")
Set rst = New ADODB.Recordset