2023信创独角兽企业100强
全世界各行各业联合起来,internet一定要实现!

创建一个空数据库

2004-02-11 eNet&Ciweek

  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  

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

相关频道: eNews

您对本文或本站有任何意见,请在下方提交,谢谢!

投稿信箱:tougao@enet16.com