case insensitive search

  • Thread starter Thread starter Rudi Ahlers
  • Start date Start date
R

Rudi Ahlers

I got a DB, and sometime users enter stuff in uppercase. How do I display
the rows,regardless if the field is uppercase, of lowercase?

For example, SelectQuery = "SELECT DISTINCT id, currentdate, commenttype,
username, supplier, subject, clientresponse, vote FROM comments WHERE
supplier = '" & company_name & "'"

Then later, I run the recordset, displaying info, until the end of the
recordset has been reached. The problem is, it would display the supplier
field with uppercase in a seperate field than the ones in lowercase. How do
I avoide this? I have a large DB full of these entries, so I need todo
something onthe query side


--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
 
I'm not sure what RDBMS is in use, but UPPER and LOWER work in SQL
Server to make character data all upper case or all lower case - I
believe this is the question you are asking.

You should strongly consider a parameterized query or moving your SQL
into a stored procedure to reduce the risk of SQL injection attacks.
String concatenations with user input are really dangerous to send to
the DB.
 
Back
Top