ms访问-如何通过编程将ACCDB转换为MDB



是否有方法以编程方式将Access 2010 ACCDB文件转换为Access 95/97 MDB文件?

以下是一些注意事项。我没有旧版本可以玩,所以我不知道你是否可以导入比导出更多的内容:

Dim ws As Workspace
Dim db As Object
Dim tdf As TableDef
Dim qdf As QueryDef
Dim dbExp As Database
Dim acApp As New Access.Application
acApp.OpenCurrentDatabase "z:docsdemo.accdb"
Set dbExp = acApp.CurrentDb
Set ws = DBEngine.Workspaces(0)
FName = "z:docsoldver95.mdb"
''Access 95
Set db = ws.CreateDatabase(FName, dbLangGeneral, dbVersion30)
''You can only export tables and a limited range of datatypes
For Each tdf In dbExp.TableDefs
    If Left(tdf.Name, 4) <> "Msys" Then
        acApp.DoCmd.TransferDatabase acExport, "Microsoft Access", _
           FName, acTable, tdf.Name, tdf.Name
    End If
Next

请参阅http://msdn.microsoft.com/en-us/library/office/bb243161(v=office.12).aspx

使用VBScript演示使用引擎的几个注意事项:

Dim objEngine
Dim objWS
Dim objDB
Dim db: db = "z:docsoldver95.mdb"
Set objEngine = CreateObject("DAO.DBEngine.36")
Set objDB = objEngine.OpenDatabase(db)
strSQL="SELECT * FROM Table1"
objDB.CreateQueryDef "Query1", strSQL

相关内容

  • 没有找到相关文章

最新更新