Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change users passwords from the admin login

Status
Not open for further replies.

jacq

Technical User
Jan 3, 2001
38
GB
i have a dB with many users who frequently forget their passwords (i have a table - tblName - that contains all the users passwords and logins).
i tried to use
object.NewPassword oldpassword, newpassword, but i can't set the object (user), as it wants the workgroup user, and won't accept a login name from the table.
i want to let the dB owner reset users passwords rather than them coming back to IT all the time but i can't give them admin rights to break into the dB.

any other ideas?
 
jacq,

I'm confused. Are you using user-level security? If so, how do you have a table of all of the passwords? What is your setup?

It's certainly easy enough to write code that resets the user's password to blank. I would think you could then run a bit more code to change it to whatever you'd like, though I've never had a need to do that.

Is there no database administrator who has rights to do this manually? Seems risky.

And why are these people constantly forgetting their passwords? Push back on them a little more and they may become less forgetful.

In any case, let us know a bit more about your security scheme and we may be able to help you out.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access databases since 1995.
 
i am using user level security, but i also store the logins in a table with a date so that users have to change their passwords every two months (i initially set up the code to store all information, so by default i have the password but i don't want the users to know).
the dB user/administrator does not have dB knowledge and whilst they have admin rights to add new users via some vb code on a form, i do not want them breaking into the dB to reset passwords.
we have 700 plus users who are not all computer literate and they do forget their passwords (many are temporary staff).
i want to be able to select a user name from the table, get their login name (which is the same as in the system file) and reset their password back to abc123.
 
jacq,

Here's some code I've got that changes passwords. I guess I forgot I had this in my application until I read your last post. That's a little scary...

You'll at want to make some changes, of course.

Jeremy

Public Function ChangePassword(sOldPwd As String, sPwd1 As String, sPwd2 As String)
'(c)Copyright 2/6/01 Jeremy Wallace, AlphaBet City Dataworks. jeremy@alphabetcitydataworks.com
On Error GoTo Error
Dim wsp As Workspace
Dim uUser As User

Set wsp = DBEngine.Workspaces(0)
Set uUser = wsp.Users(CurrentUser)
If sPwd1 = sPwd2 Then
uUser.NewPassword sOldPwd, sPwd1
DoCmd.Close
Forms!frmswitchboard.Visible = True
Else
Call MsgBox("The passwords did not match. Please try again.", vbOKOnly + vbInformation, _
"Data Conflict")
End If
Exit Function
Error:
Select Case Err.Number
Case 3033 'wrong current password
Call MsgBox("You entered the current password incorrect. Please try again.", vbOKOnly + vbInformation, _
"Data Conflict")
Case Else
Call ErrorTrap(Err.Number, Err.Description, "ChangePassword")
End Select
End Function
=============
Jeremy Wallace
Designing, Developing, and Deploying Access databases since 1995.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top