Password with case sensitive (1 Viewer)

Sokkheng

Member
Local time
Today, 17:50
Joined
Jul 12, 2023
Messages
34
I have password input form for input user name and password, but in password text box when user input capital or lower-case it true the same way.
Example: password and Password it true the same. how to make more restrict with capital and lower-case.
Thanks
 

isladogs

MVP / VIP
Local time
Today, 11:50
Joined
Jan 14, 2017
Messages
18,225
By default, Access is case insensitive.
See my example app which includes code to check case in an entered password using the StrComp function
 

Josef P.

Well-known member
Local time
Today, 12:50
Joined
Feb 2, 2023
Messages
826
I would also use StrComp, for completeness I still show:
Code:
Option Compare Binary '  <-- affects the whole code module! (is by the way standard, if you don't set Option Compare)
'Option Compare Database <-- here you also have to be careful, because the database could theoretically be set case insensitive
'Option Compare Text '<-- this is what I usually use, so case insensitive is fixed
Option Explicit

Private Sub Test()

   If "a" = "A" Then
      Debug.Print "a is equal to A"
   Else
      Debug.Print "a is not equal to A"
   End If

End Sub

BTW:
You won't store a password in plain text and with a non-reversible hash comparison I don't think case sensitive is that important, is it? StrComp with binary comparison I would do anyway, because it doesn't hurt. :)
 
Last edited:

Users who are viewing this thread

Top Bottom