Error -2147217911 when changing a user password

T

Tony_VBACoder

In my Secure Access 2002 application, I have created a
form where the user can change their password. I have
noticed that if I provide the wrong old password for the
user, I get the error: "-2147217911: You do not have the
necessary permissions to use the '<<UserName>>' object.
Have your system administrator or the person who created
this object establish the appropriate permissions for
you." If I supply the correct OLD password, I get no
error, it is only when I supply the incorrect OLD password
that I get this error. Is this error number correct? It
seems like a very strange error number.

My code to update the password is:

Public Function bChangeUserPassword(sUserName As String,
sPasswordOld As String, sPasswordNew As String) As Boolean
Dim cat As ADOX.Catalog
Dim usr As ADOX.User

On Error GoTo Oops

Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection

Set usr = cat.Users(sUserName)
usr.ChangePassword sPasswordOld, sPasswordNew

bChangeUserPassword = True

Exit Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top