Converting a Access 2000 DB to a 97DB in VBA
Posted on 2002-07-19
I am trying to write this code to create a copy of the
main 4 tables in my database into a different Access
I am using Access 2000 and need to convert a copy of the
backup database to 97 for a co-worker.
The code below works fine until the line:
I get a runtime error of 2046 and a message that says
The comaand or action 'Convert DataBase' isn't
I even created a database with an sub that had
DoCmd.RunCommand acCmdConvertDatabase as its only line and
the message was the same.
Any ideas to get this to work or another way to do it.
Dim appAccess As Access.Application
Dim dbsCurrent As Database, dbsContacts As Database
Set dbsCurrent = CurrentDb
Dim dbs As Object, tdf As Object, fld As Variant
Dim strDB As String
Const DB_Text As Long = 10
Const FldLen As Integer = 40
' Initialize string to database path.
strDB = "C:\Newdbcwd7.mdb"
' Create new instance of Microsoft Access.
Set appAccess = _
' Open database in Microsoft Access window.
' Get Database object variable.
Set appAccess = Nothing
Set dbs = CurrentDb()
Set dbsContacts = DBEngine.Workspaces(0).OpenDatabase
' Create new table.
DoCmd.CopyObject strDB, , acTable, "tblCuidOld"