Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   Password change forms (https://www.askmehelpdesk.com/showthread.php?t=178954)

  • Jan 31, 2008, 11:58 AM
    CoverSix
    Password change forms
    I secured a form in my Access database with the following code:

    Private Sub Command48_Click()
    'Attached to On Click event of Command48

    Dim strPasswd

    strPasswd = InputBox("Enter Password", "Restricted Form")

    'Check to see if there is any entry made to input box, or if
    'cancel button is pressed. If no entry made then exit sub.

    If strPasswd = "" Or strPasswd = Empty Then
    MsgBox "No Input Provided", vbInformation, "Required Data"
    Exit Sub
    End If

    'If correct password is entered open Secure Personnel form
    'If incorrect password entered give message and exit sub

    If strPasswd = "******" Then
    DoCmd.OpenForm "Secure_Form", acNormal

    Else
    MsgBox "Access Denied", vbOKOnly, "Important Information"
    Exit Sub
    End If
    End Sub

    My boss loved this, then asked me how he could change the password without having to crack open the code to do it. So now I need to modify the above code to include a functionality to change the password.

    I'm not a programmer, and the little VB I know I learned in school over a year ago. Can anyone provide a solution? Thanks!
  • Feb 22, 2008, 04:20 PM
    kabia
    You could read / write to an Ini file and compare what was in the Ini file to what was typed in...
    Or just create a file that it opens and reads to compare...
    Not recommended if you were to package and deploy...
    But in a small environment could be OK... All your boss would need to do is open the file and write the new password in...
    With an ini file you could encrypt it... so then you would need to decrypt it within your program, so have an admin section in your program to setup passwords etc...
    Hope this gave you some ideas anyway..

  • All times are GMT -7. The time now is 01:54 AM.