How to reset a password

Hi there, i want to be able to reset a password without going to the security option of tools in the main menu.
I want to give the user (the dumb's one) a way to reset his password without having access to trhe source code or any of the object. So if there is some code i can use i would put that in an "Managing Form" so the user can go there enter is user and reset his password
tuskenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cekmanCommented:
Try this function - this is from FMS SOURCEBOOK software:

Function ChangeUserPassword_TSB(strWorkspace As String, strUser As String, strOldPass As String, strNewPass As String) As Boolean
  ' Comments  : Changes the named user's password
  ' Parameters: strWorkspace - name of the workspace to use or "" (blank string) for Workspaces(0)
  '             strUser - name of the user
  '             strOldPass - user's current password
  '             strNewPass - user's new password
  ' Returns   : True if password was changed, False otherwise
  '
  Dim wrkTemp As Workspace
  Dim usrTemp As USER

  On Error GoTo PROC_ERR

  If strWorkspace = "" Then
    Set wrkTemp = DBEngine.Workspaces(0)
  Else
    Set wrkTemp = DBEngine.Workspaces(strWorkspace)
  End If

  Set usrTemp = wrkTemp.Users(strUser)
  usrTemp.NewPassword strOldPass, strNewPass

  ChangeUserPassword_TSB = True

PROC_EXIT:
  Exit Function

PROC_ERR:
  ChangeUserPassword_TSB = False
  Resume PROC_EXIT

End Function
0
tuskenAuthor Commented:
Ok that is good but you need the old password... i really need to reset it because the user don't remember his password (i told you they where dumb!!)
so is that possible with that function, is it possible anyway and if yes how??

 
0
BrianWrenCommented:
Hating to type, (and read a lot of characters...), I'd like to see in place of some of that:

Public Function ChgPw(WkSp As String, strUser As String, strOld As String, strNew As String) As Boolean

  ' Comments  : Changes the named user's password
  ' Parameters: WkSp - name of the workspace to use or "" (blank string) for Workspaces(0)
  '             strUser - name of the user
  '             strOld - user's current password
  '             strNew - user's new password
  ' Returns   : True if password was changed, False otherwise

  On Error GoTo ChgPw_Err
 
  Dim wkTmp As Workspace
  Dim usrTmp As USER

  If strWkSp = "" Then
    Set wkTmp = DBEngine(0)
  Else
    Set wkTmp = DBEngine.Workspaces(WkSp)
  End If

  Set usrTmp = wkTmp.Users(strUser)
  usrTmp.NewPassword strOld, strNew

  ChgPw = True

ChgPw_Res:
  Exit Function

ChgPw_Err:
  ChgPw = False
  Resume ChgPw_Res

End Function

Brian

0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

tkuppinenCommented:
That attitude sort of reminds of that new character from SNL, the company computer expert .  Just remember if you're users get too "smart" then you're out of a job.
0
cekmanCommented:
In the  Access 97 Developer's Handbook I found the following - basically using the same code:

"Only Admins members can change other users' passwords. For Admins member, old pwd is ignored.
When you use the NewPassword method, yoru are required to enter the correct old password if the account is the same as the value of CurrentUser; otherwise you don't have to enter the old password - the string is ignored. This behaviour is consistent with the Access UI, where you can clear someone else's password. The difference in DAO is that you can both clear and reset the password and set it to a new nonblank value in one step (as long as your an ADMINS member."

I didn't see anything about a user resetting their own password without first providing their old password.


CEKMAN
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BrianWrenCommented:
From Access Help:

Clear a security account password
To complete this procedure, you must be logged on as a member of the Admins group.

It doesn't look as if a user can change his password unless he already knows what it is...

(Maybe they are too stoopidd to use a compyootur...)

Brian
0
tuskenAuthor Commented:
Exactly what i needed

Thx

0
BrianWrenCommented:
by 0:02 minutes!  Oh well...
0
tuskenAuthor Commented:
i have another one coming... so try to be faster this time :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.