首页 > 开发 > 综合 > 正文

创建一个带密码的空数据库

2024-07-21 02:12:31
字体:
来源:转载
供稿:网友
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



收集最实用的网页特效代码!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表