Results 1 to 7 of 7

Thread: Passwords (AXP)

  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passwords (AXP)

    Hello All,
    I have a password field in a table formatted with an input mask of PASSWORD. It does a nice job of storing passwords in "******" format. They are not case sensitive. I mean that I can open a password entry form, make the user enter their user name and password, and then compare the password to what is in the table. Even though I input a password in CAPS in the table, the form is perfectly happy that I entered the password in lower case. How do I make some code to make the string match exactly?

    Thanks,
    Mark

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Passwords (AXP)

    You can do this using the Option Compare Binary method placed in a module.

    - Create a Module
    - Put Option Compare Binary as the first line. (This feature treats upper and lower case as different value)
    - Add code to check the data.
    - Call the Sub from your code when you check the value of the password input to the stored value.

    For example, Create a Module called OCP with the following in it:

    Option Compare Binary

    Sub CheckPassword()
    If Name <> "VALUETOCHECK" Then
    MsgBox "Username and/or Password are invalid. Try Again.", vbInformation, "Logon Status"
    Exit Sub
    End If

    Notes:
    - Name is passed in as a public variable in another module
    - VALUETOCHECK is the value to verify the name against. The case (i.e. Upper or Lower) must match. In this example, VALUETOCHECK is hardcoded, but you could pass that value as well.
    End Sub


    Try looking up Option Compare Binary in the help files for more information.

    HTH
    Regards,

    Gary
    (It's been a while!)

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passwords (AXP)

    Thanks a ton, I'll try that tonight.

    Thanks,
    Mark

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Passwords (AXP)

    Your post sounds suspiciously like you are reinventing user security - is there a reason why you don't want to use the Access User Security feature?
    Wendell

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passwords (AXP)

    I do want to pursue the access security thing. I need something quick and dirty for now. I do remember using the security file before on a previous project and it was more in depth then I have the time for at this moment.

    Thanks,
    Mark

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Passwords (AXP)

    The problem with the form approach is that all somebody has to do to get into your database is hold down the shift key when they start it - that prevents the form from loading. Applying Access security is much easier than jumping through all the hoops you need to make your own system. All you really have to do is give a password to Admin, and then create the user accounts. You do need to make sure everyone uses the same system.mdw file, but that's about it unless you really want to button things up. Take a look at our tutorial on security - it gives you the basics and lots of references to detailed technical information should you need it.
    Wendell

  7. #7
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passwords (AXP)

    Thanks Wendell,
    I downloaded all of those docs and will study them.

    Thanks,
    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •