The following is a function that modifies a workgroup user's password, using "" instead of NULL when invoked when the password is null, which is different. :)
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", "")
'//To pay special attention to the above sentence, you must open the workspace with a username and password that has the database Admin permissions!
'//The following paragraph is to find out if the user name exists, if it exists, modify the password, there is no error reporting.
For i = 0 to wk. Users.count-1
If wk. Users (i). Name = UserName Then
Set Ur = wk. Users (i)
Found = True
Ur.newpassword OldPassword, NewPassword
Exit for
End If
Next I
If not Found Then
MsgBox "'" & UserName & "' is not a valid username! ",_
vbexclamation, "Aysais Application Network"
Checkuserpasswordingroup = False
Exit Function
End If
Checkuserpasswordingroup = True
Exit Function
Chkerr:
MsgBox "'" & UserName & ' user password modification failed! ",_
vbexclamation, "Aysais Application Network"
Checkuserpasswordingroup = False
End Function