I am trying to convert this Excel Spreadsheet to 2007. It connected to Access. So I changed the paths and provider. Also changed the References to MS Access 12.0 Object Library and MS Excel 12.0 Object Library.
In the Code I changed from mdb to accdb.
I am getting a runtime error 3343 unrecognized database format then it lists the path.
The path is right.
In the code , first is the new code and in the second piece I comment out which worked.
Any help would be appreciated.
Public Sub OpenDB2()
Dim db As DAO.Database
Dim ws As DAO.Workspace
Dim rst As DAO.Recordset
Dim i As Integer
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase _
False, False, "MS Access;PWD=XXXX")
' Set ws = DBEngine.Workspaces(0)
' Set db = ws.OpenDatabase _
' ("XXX\XX\XX\XX.mdb", _
' False, False, "MS Access;PWD=XXXXX")