Click here to Skip to main content
15,878,945 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys! I don't know how to check for Caps lock in a query. For example I have a Access Database with a few fields (Username,Password). Now here is the problem, when I debug I typed the following information (Correct Data from Access Database)

What I have tried:

Username : admin & Password : admin

It works fine but when I put Username : ADMIN & Password : ADMIN
it should be an error but it still loads my messagebox
VB
msgbox("Login Successful!")
Posted
Updated 31-Jul-18 23:42pm
Comments
Jochen Arndt 1-Aug-18 4:31am    
The interesting portion of your code would be that which gets the user input, queries the database and leads to the message box being shown.

It's pretty normal to accept usernames in whatever case your user types at the time: indeed, many systems are deliberately case-insensitive with username comparisons ... but if your password is case insensitive then that means you have done something very, very wrong, and that error is normally storing passwords in plain text.

Never store passwords in clear text - it is a major security risk. There is some information on how to do it here: Password Storage: How to do it.[^] - the code is C# but it's pretty obvious, and there are online converters if you can't work it out: C# to VB converter[^]
 
Share this answer
 
Quote:
How to check for CAPS lock in a query

Short answer: You don't need, it is useless here. "CAPS lock" is keyboard status and is not related to user input.
To convert or test if user input is lowercase or uppercase, use ToLower or ToUpper string functions.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900