分类广告


推荐文章

  • 没有找到任何内容!
您当前的位置:中国站长下载数据库区MS Access → 文章内容

创建一个空数据库

  • 作者:佚名    来源:不详    发布时间:2005-10-12 10:05:44
  • 字体大小:
Function CreateNormalDB(strPathName As String) As Boolean
On Error GoTo Exit_ERR
Dim wrkDefault As Workspace
Dim NewDB As Database

CreateNormalDB = False
Set wrkDefault = DBEngine.Workspaces(0)
If Dir(strPathName) <> "" Then Kill strPathName
Set NewDB = wrkDefault.CreateDatabase(strPathName, dbLangGeneral)

NewDB.Close
Set NewDB = Nothing

CreateNormalDB = True
Exit Function

Exit_ERR:
MsgBox "备份失败!" & vbCrLf & vbCrLf & Err.Description, vbExclamation
Exit Function
End Function

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