Ask Experts Questions for FREE Help !
Ask
    darren8's Avatar
    darren8 Posts: 1, Reputation: 1
    New Member
     
    #1

    Mar 1, 2003, 09:32 AM
    VB password scripts
    Could someone please tell me how to write a password script in Visual Basic 6.0. I need to link a password form to another form so that if the password is entered correctly then it will open the linked form.
    YDG's Avatar
    YDG Posts: 4, Reputation: 1
    New Member
     
    #2

    Mar 17, 2003, 07:12 PM
    VB password scripts
    Well, the easiest way is to not have an extra password form, and just do it with an Input box when the main form loads, like this:

    Private Sub Form_Load()
    Dim strPass as String
    StrPass = InputBox("Enter Password")
    If strPass <> "Password" Then
    MsgBox "Access denied"
    End
    End If
    End Sub

    (replace "Password" with whatever you want the password to be).
    This pops up an input box before the form becomes visible, and if the password is wrong, it exits the program. This code doesn't have to be in the Form_Load() event necessarily, for instance if you wanted a form to display some graphics along with asking for a password (such as a title page), you could just add a panel to your main form, the size of the form itself, and make it visible when the program loads, so that the rest of the program is hidden, and include a text box and button on this panel, asking for a password. Then it's just a matter of using the above code (without the Input Box) to check the password and shut down.

    If neither of these appraches are what you're looking for (ie if you reeeeeally have to have another form come up at the start ;)), post back and I'll dig up an example :)

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Password ? [ 17 Answers ]

:o ? :'( How do you get into your computer if you forgot and lost you password?

Password [ 2 Answers ]

:o Someone please help me to get my own official Yahoo accounts password; Very important data is being saved dere about my clients... Can anyone guide me how to recover that Yahoo password: [email protected]

A password for my PC [ 4 Answers ]

Hello experts, How can I do a password for my PC so no one can use it. Thanks in advance

Hotmail Password? [ 6 Answers ]

I don't plan on doing anything illligal, but I have lost my hotmail password, would it bee possible for me to make a program, like how like zip password recovery programs work, it will enter every possible password until it finds the correct one, would this be possible to do/?


View more questions Search