Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1509
  • Last Modified:

How to make a password case sensitive

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:~)
0
janandben
Asked:
janandben
2 Solutions
 
GRayLCommented:
You have to process the password inside a module in which you have placed this line in the header

Option Compare Binary

0
 
Jeffrey CoachmanMIS LiasonCommented:
<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
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
janandbenAuthor Commented:
HUH. . .
0
 
GRayLCommented:
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.
0
 
GRayLCommented:
janandben:  Having a problem?
0
 
hnasrCommented:
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
0
 
hnasrCommented:
Text20 displays the text entered in (Text18 -Format PASSWORD).
0
 
hnasrCommented:
Another way, is to check for password using StrComp function.

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

if equal, result evaluates to 0
0
 
Patrick MatthewsCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now