ucase & lcase with access sql statements in asp

I have a native ASP application that makes calls to access dbs for lookups.  is there a way to eliminate the issues with queries and lcase/ucase situations.  The user may have changed their id from john.doe@gmail.com to John.Doe@gmail.com and I need to make sure I pick up both.

  strSQL1 = "SELECT * from officials WHERE email='" & rs("official1") & "'"
Matt PinkstonAsked:
Who is Participating?
Gustav BrockCIOCommented:
Try with:

strSQL1 = "SELECT * from officials WHERE UCase(email)='" & UCase(rs("official1")) & "'"

And once you are there, avoid problems with spaces. It happens often enough that people enter a space before or after their email:

WHERE UCase(Trim(email))='" & UCase(Trim(rs("official1"))) & "'"
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.