Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    139

    Unanswered: password validation characters, numbers

    I've got an application that requires a password. I need to be able to specifiy so many characters, numbers, symbols required for a 6 character password.

    Can anyone suggest a validation method that will address this?
    Thanks,
    Bill

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    The only way I can see is to wrtie your own validation rules and then build the VBA.

    To check the number of cahracters use the len() function

    AFAIK there is no equivalent of regular expressions (as in C, PHP, PERL etc), so to check for a mix of characters then you need scan through the string to check for valid (and invalid).

    You may need to check using the ASC() to check for specific characters. Alternatively you could check the character is numeric [isnumeric()], coerce the character to be numeric [Cint()] and then perform any checks (if you don't care about the number is numeric should be ok

    You could check for the presences of upper case characters by converting a copy of the password to lower case and see if the new matches the original. And check for lower case charcaters converting a copy to upper case and check for differences.

    Ber in mind yiou may also want to check for non vlaid charcters ie anything outside a specific ASCII() range

    HTH

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I had to do this once. I created a password class that would allow me to create an object, give it my string and tell it to execute validation. Once it did that, the object had various properties such as numeric_count, alpha_count, length, lcase_count, ucase_count etc. I could then compare the values of the various properties against my complexity requirements to determine whether it was a good match. there were other periphal reasons I went with the object, need for encryption/decryption etc. You could do the same thing using a function I guess, might be a little strange.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Mar 2004
    Posts
    139
    Thanks for the responses...I think I can see how to do this now. Only thing I don't have yet is how to identify the symbols like #$@. The asc() function returns the character code integer. There's a listing of the character s/character codes and a chr function that will return the character based on a number. But I don't see any way to check for symbols other than to manually create a table from the listing provided, convert the character to a number with asc(), and check this number against the table.

    Any ideas?
    Thanks,
    Bill

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Think backwards. if it's not a number or an alpha character, then it's a symbol/special character. Since the alphanumeric set is all in ranges, that's a bit easier to test for.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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