Click here to Skip to main content
14,932,737 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
msgbox("Login Successful!")
Updated 31-Jul-18 23:42pm
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[^]
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.

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