Dim appAccess As Object
Set appAccess = CreateObject("Access.Application")
appAccess.Application.Visible = True
appAccess.SaveAs "C:\TEST.mdb" ‘系统提示对象错误!请改!
appAccess.Application.Quit
Set appAccess = Nothing
嘿嘿,搞定了,不用了谢谢!
用代码创建个新的数据库:
Dim wrkDefault As Workspace
Dim dbsNew As Database
' Get default Workspace.
Set wrkDefault = DBEngine.Workspaces(0)
' Make sure there isn't already a file with the name of
' the new database.
If Dir("NewDB.mdb") <> "" Then Kill "NewDB.mdb"
' Create a new encrypted database with the specified
' collating order.
Set dbsNew = wrkDefault.CreateDatabase("NewDB.mdb", _
dbLangGeneral, dbEncrypt)