Const sDBpath = "C:\Users\ChopperDave64\Documents\Repair Busniess\DB\"
Const sDBfileName = "Repair Data Tracking.accdb"
Dim bDBopen As Boolean, bInit As Boolean
Dim dbRepairBus As DAO.Database
Private Sub Class_Initialize()
Dim bRes As Boolean
bRes = OpenDB()
Debug.Print "CCNXtoDB constructor OpenDB = " & bRes
Function OpenDB() As Boolean
Set dbRepairBus = DAO.DBEngine.OpenDatabase(sDBpath & sDBfileName) ' <-- Causes run time error 3343
bDBopen = True
OpenDB = bDBopen
Function TestClass() As Boolean
Dim RepairDB As CNXtoDB
Set RepairDB = New CNXtoDB
I've seen other discussions about run time error 3343, but none that I have read has helped me.
I am trying to open an MS Access 2007 .accdb file using VBA in Excel 2007. I noted the offending line of code.
I thought this should be straight forward, but I don't understand why this is not working. Any help is appreciated!
Thanks and Merry Christmas.