最近很多朋友喜欢上设计,但是大家却不知道如何去做,别担心有图老师给你解答,史上最全最棒的详细解说让你一看就懂。
【 tulaoshi.com - 编程语言 】
Function CreatePassWordDB(strPathName As String, strPsd As String) As Boolean
On Error GoTo Exit_ERR
Dim wrkDefault As Workspace
Dim NewDB As Database
CreatePassWordDB = False
Set wrkDefault = DBEngine.Workspaces(0)
If Dir(strPathName) "" Then Kill strPathName
Set NewDB = wrkDefault.CreateDatabase(strPathName, dbLangGeneral & ";pwd=" & strPsd & "")
NewDB.Close
Set NewDB = Nothing
CreatePassWordDB = True
Exit Function
Exit_ERR:
MsgBox "备份失败!" & vbCrLf & vbCrLf & Err.Description, vbExclamation
Exit Function
End Function
来源:http://www.tulaoshi.com/n/20160219/1604454.html
看过《创建一个带密码的空数据库》的人还看了以下文章 更多>>