We help IT Professionals succeed at work.

How to make a password case sensitive

Medium Priority
2,110 Views
Last Modified: 2013-11-28
I created a password unbound text box in a form using a password input mask in properties, but it is not case sensitive. How do I make it case sensitive?  Please be detailed, because I am a novice:~)
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
<You have to process the password inside a module in which you have placed this line in the header
Option Compare Binary>

Again...
"Every day is a school day"

;-)

Jeff

Author

Commented:
HUH. . .

Commented:
Press Alt+F11 to get to the VB Window.  In Help type - Option Compare.

It looks like the module in which you process your comparison has the Option Compare set to Text or Database.  As you can see from Help,  it has to be Binary for a String comparison to be case sensitive.

Commented:
janandben:  Having a problem?
Hamed NasrRetired IT Professional
CERTIFIED EXPERT

Commented:
Option Compare Binary takes care of case.
But if this is not required for other operations, then processing of the password helps.

Change the password to concatenation of ascii code of each character.
Ex:
Password AbA ----> 659865

Try this with an unbound text box, exit event for a password AbA. Option Compare Database

Private Sub Text18_Exit(Cancel As Integer)
    Dim s As String
    Dim I As Integer
    s = ""
    Text20 = Text18.Text
    For I = 1 To Len(Text18.Text)
        s = s & Asc(Mid(Text18.Text, I, 1))
    Next
    If s = "659865" Then Debug.Print "match ", Text18.Text
End Sub
Hamed NasrRetired IT Professional
CERTIFIED EXPERT

Commented:
Text20 displays the text entered in (Text18 -Format PASSWORD).
Hamed NasrRetired IT Professional
CERTIFIED EXPERT

Commented:
Another way, is to check for password using StrComp function.

result = StrComp(Text20,"YourPassword",vbBinaryCompare)

if equal, result evaluates to 0
CERTIFIED EXPERT
Top Expert 2010

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.