I am trying to open and manipulate an MS Access Database from Reflections VBA. I have included the MS Access 9.0 Object Library in the "Tools References". The following code compiles but does not open MS Access or the database I need.
Sub RunAccess()
' written by C. Canter 22-MAR-2002
' initialize string to database path
Dim appAccess As Access.Application
Const strConPathToSlow = "C:\slow_move\Slow.mdb"
strDB = strConPathToSlow & "Slow.mdb"
'Create new instance of Microsoft Access
Set appAccess = CreateObject("Access.Application"
'open database in MS Access Window
appAccess.OpenCurrentDatabase strConPathToSlow
appAccess.DoCmd.OpenTable "table1"
End Sub
I've copied it right out of the MS Access help manual so it should be ok. The path and database exist on the C:\ drive.
Any suggestions? Craig Canter
Cost Accountant
Sipex
Milpitas, CA
Sub RunAccess()
' written by C. Canter 22-MAR-2002
' initialize string to database path
Dim appAccess As Access.Application
Const strConPathToSlow = "C:\slow_move\Slow.mdb"
strDB = strConPathToSlow & "Slow.mdb"
'Create new instance of Microsoft Access
Set appAccess = CreateObject("Access.Application"
'open database in MS Access Window
appAccess.OpenCurrentDatabase strConPathToSlow
appAccess.DoCmd.OpenTable "table1"
End Sub
I've copied it right out of the MS Access help manual so it should be ok. The path and database exist on the C:\ drive.
Any suggestions? Craig Canter
Cost Accountant
Sipex
Milpitas, CA