程序员人生 网站导航

创建一个空数据库

栏目:access时间:2013-11-27 00:26:45

   Function CreateNormalDB(strPathName As String) As Boolean
On Error GoTo Exit_ERR
Dim wrkDefault As Workspace
Dim NewDB As Database

CreateNormalDB = False
Set wrkDefault = DBEngineWorkspaces()
If Dir(strPathName) <> "" Then Kill strPathName
Set NewDB = wrkDefaultCreateDatabase(strPathName dbLangGeneral)

NewDBClose
Set NewDB = Nothing

CreateNormalDB = True
Exit Function

  Exit_ERR:
MsgBox "备份失败!" & vbCrLf & vbCrLf & ErrDescription vbExclamation
Exit Function
End Function

  &#;调用时只需提供路径及文件名即可此函数为备份数据模块的一部份

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐