FunctionCreatePassWordDB(strPathNameAsString,strPsdAsString)AsBoolean
OnErrorGoToExit_ERR
DimwrkDefaultAsWorkspace
DimNewDBAsDatabase
CreatePassWordDB=False
SetwrkDefault=DBEngine.Workspaces(0)
IfDir(strPathName)<>""ThenKillstrPathName
SetNewDB=wrkDefault.CreateDatabase(strPathName,dbLangGeneral&";pwd="&strPsd&"")
NewDB.Close
SetNewDB=Nothing
CreatePassWordDB=True
ExitFunction
Exit_ERR:
MsgBox"備份失敗!"&vbCrLf&vbCrLf&Err.Description,vbExclamation
ExitFunction
EndFunction