I see people throwing in all kinds of fancy string comparing code and functions... I am puzzled, why not just compare 2 variables?
Variables strUserName_Entered and strPassword_Entered are entered by user and variables strUserName_DB and strPassword_DB are loaded from DB.
If strUserName_Entered = strUserName_DB AND strPassword_Entered = strPassword_DB Then
' Everything is OK, entered username/password combination is exactly the same as the one from DB
Else
' Username/password combination do not match
End If
If you specifically want to differentiate when user enters the right username/password but in wrong case then you can use this
If strUserName_Entered = strUserName_DB AND strPassword_Entered = strPassword_DB Then
' Everything is OK, entered username/password combination is exactly the same as the one from DB
Else If UCase(strUserName_Entered) = UCase(strUserName_DB) AND UCase(strPassword_Entered) = UCase(strPassword_DB) Then
' Username/password combination match, but at least one or more characters is/are in a wrong case
Else
' Username/password combination do not match (not the case error)
End If