Password

shadowraven

Registered User.
Local time
Today, 22:57
Joined
May 14, 2002
Messages
75
Is it posssibel to have a button on a form so when its clicked it will enabel the user to change there password in a format like enter old user name enter old password,enter new password.

can you do a step by step sort of thing as im total newbie to all this stuff.

[This message has been edited by shadowraven (edited 05-21-2002).]
 
Yes, it is possible. However, what I see in other topics is that you are doing your own password management rather than using Workgroup security. Not that I blame you for that choice, you understand.

For a beginner, you are being a bit ambitious. I would suggest the following approach.

Build a password change form that contains three text fields with labels "Account Name", "Old Password", "New Password", "New Pwd Verification" All of these fields should be unbound.

Make the foreground and background colors either all black or all white for Old Password, New Password and New Pwd Verification.

If a user enters a valid username, the correct old password, and matching values for new password and new password verification, enable a button that says "Update" or "Commit" or something like that. When you click it, open a recordset to your password table where the criterion is

"Account Name" = """ & [AcctNameOnForm] & """"

(or whatever you called the field on the form.)

Then verify that there is a record, verify that the Old Password was entered correctly, and if the new password and verification match, modify the stored password and do a .Update on the recordset.

Close the recordset when done.
That's it.
 
Here is a code that came with my data base when i downloaded it but when i clicked to change the new passowrd it was saying something was missing so i pointed it at my password tabel and all seemed ok but when i changed my password it says its done correctly but i cant logon with that password so im lost here.
can I please email you my database as im lost and im messing up my database bigtime.

Option Compare Database
Option Explicit

Private Sub cmdCancel_Click()
On Error GoTo Err_cmdCancel_Click

Dim intResponse As Integer

Forms!frmUserLogonNew.Visible = False

intResponse = MsgBox("Warning: By canceling, you are about to completely exit the database." & Chr(13) & _
"Are you sure you want to do this?", vbYesNo + vbExclamation, "Exiting Database")

Select Case intResponse
Case vbYes
DoCmd.Quit
Case Else
Forms!frmUserLogonNew.Visible = True
End Select


Exit_cmdCancel_Click:
Exit Sub

Err_cmdCancel_Click:
MsgBox Err.Description
Resume Exit_cmdCancel_Click

End Sub

Private Sub cmdOk_Click()
On Error GoTo Err_cmdOk_Click
'-----------------------------------------------------------------------------------------------------------
' This code is used to change the user password in the tblSecurity table.
' Created by: TSgt Richard Rensel
' Date Created: 20 Jan 2000
'----------------------------------------------------------------------------------------------------------

Dim stDocName As String
Dim stLinkCriteria As String

If Not IsNull(Me.txtNPassword) And Not IsNull(Me.txtCPassword) Then
If Me.txtCPassword = Me.txtNPassword Then
stDocName = "qryUpdateUserPassowrd"
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True
MsgBox "Password was successfully change", vbOKOnly + vbInformation, "Password Changed"
stDocName = "frmStartup"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "New password and confirmation do not match." & _
Chr(13) & "Please enter the correct password and confirm", vbOKOnly + vbInformation, "Incorrect Password"
End If
Else
MsgBox "You left the User Name and/or Password blank." & Chr(13) & _
"Please enter the correct User Name and Password or " & Chr(13) & _
"contact the Database Adminstrator for assistance.", vbOKOnly + vbCritical, "Change Failed"
End If

Exit_cmdOk_Click:
Exit Sub

Err_cmdOk_Click:
MsgBox Err.Description
Resume Exit_cmdOk_Click

End Sub




[This message has been edited by shadowraven (edited 05-22-2002).]
 

Users who are viewing this thread

Back
Top Bottom