In a routine I wrote to encrypt a login password for a database I have come across an oddity. For each character in the entered password I compare it in turn to each of the values of the chr function to obtain the index of that character in the Ascii table so it can be used to construct the encrypted value. If the character is lower case Mid(password, i,1) is seen as equal to both the upper and lower case versions of that character. Since I loop through the Ascii table from 0 to 127, the character is always encoded as if it was upper case. Does anyone know why this is and how to bypass it? The relevant code section in my routine is
Do While counta > 0
enc_idx = enc_idx + 1
For enc_idy = 0 To 127
If Mid(passwd, enc_idx, 1) = Chr(enc_idy) Then
Exit For
End If
Next
regardless of whether the character is lower case the value of enc_idy is that of the corresponding upper case character.
Any help appreciated
Do While counta > 0
enc_idx = enc_idx + 1
For enc_idy = 0 To 127
If Mid(passwd, enc_idx, 1) = Chr(enc_idy) Then
Exit For
End If
Next
regardless of whether the character is lower case the value of enc_idy is that of the corresponding upper case character.
Any help appreciated