下面是修改工作组用户密码的函数,调用时如果用于密码为空,请使用"",不要使用null,两者不同。:)
Function CheckUserPasswordInGroup(UserName As String,_
oldPassword As String, newPassword As String) As Boolean
On Error GoTo ChkErr
Dim wk As DAO.Workspace, Ur As DAO.User, i As Integer, Found As Boolean
CheckUserPasswordInGroup = False
Found = False
Set wk = DBEngine.CreateWorkspace("", "Admin", "")
'//要特别注意上面一句,必须使用拥有数据库管理权限的用户名和密码打开工作区!
'//下面一段是查找用户名是否存在,如果存在,修改密码,不存在出错报告。
For i = 0 To wk.Users.Count - 1
...[ 查看全文 ]