Connection string to ACCESS 2010 From EXCEL 2010 no longer recognizes file
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.
Sandra
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
conn.Open
Set rng = ThisWorkbook.Worksheets("ListData").Range("A6")
Set rst = New ADODB.Recordset
Microsoft ApplicationsMicrosoft DevelopmentMicrosoft Excel
Last Comment
Sandra Smith
8/22/2022 - Mon
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Where is the variable strDatabasePath DIM'ed?
Where is the value for strDatabasePath set?
Does strDatabasePath still have the correct path tot eh database (.accdb)?
Sandra Smith
ASKER
The variable is defined in the calling procedure and passed in as a string and the path was the first thing I checked
I did all this. It it did lead me to the answer. It is not the database, it is my machine. When I moved to my laptop, it worked. At least I can finish, but have to repair my main machine.
Where is the value for strDatabasePath set?
Does strDatabasePath still have the correct path tot eh database (.accdb)?