473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Not a case sensitive search?

Below is my sql search code in my asp page. But my search seems to be case sensitive. How can i modify it to make it not case sensitive? Thanks

<%
sqlString = "SELECT product_image, product_name, product_description, product_price " &_
"FROM Products " &_
"WHERE product_status = 1 " &_
"AND ( product_name LIKE '%" & searchFor & "%' " &_
"OR product_description LIKE '%" & searchFor & "%') " &_
"ORDER BY product_name "

SET RS = Conn.Execute( sqlString )
IF NOT RS.EOF AND searchFor <> "" THEN
%>
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Jul 19 '05 #1
2 1604
What database are you using? Does it have an option to enable Case Sensitive
matching? Most databases are case insensitive.

Cheers
Ken

"Michelle" <ch************@hotmail.com> wrote in message
news:e4*************@TK2MSFTNGP10.phx.gbl...
: Below is my sql search code in my asp page. But my search seems to be case
sensitive. How can i modify it to make it not case sensitive? Thanks
:
: <%
: sqlString = "SELECT product_image, product_name, product_description,
product_price " &_
: "FROM Products " &_
: "WHERE product_status = 1 " &_
: "AND ( product_name LIKE '%" & searchFor & "%' " &_
: "OR product_description LIKE '%" & searchFor & "%') " &_
: "ORDER BY product_name "
:
: SET RS = Conn.Execute( sqlString )
: IF NOT RS.EOF AND searchFor <> "" THEN
: %>
:
:
: ************************************************** ********************
: Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
: Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
Jul 19 '05 #2

"AND ( UPPER(product_name) LIKE '%" & ucase(searchFor) & "%' " &_
"OR UPPER(product_description) LIKE '%" & ucase(searchFor) & "%') "
&_

modify case functions to suit your environment. Note that this will
impact performance since indexes may not be used. If you notice a big
difference then you might consider creating additional upper-cased
fields in your table just for searching against.

Tim.
"Michelle" <ch************@hotmail.com> wrote in message
news:e4*************@TK2MSFTNGP10.phx.gbl...
Below is my sql search code in my asp page. But my search seems to be case sensitive. How can i modify it to make it not case sensitive?
Thanks
<%
sqlString = "SELECT product_image, product_name, product_description, product_price " &_ "FROM Products " &_
"WHERE product_status = 1 " &_
"AND ( product_name LIKE '%" & searchFor & "%' " &_
"OR product_description LIKE '%" & searchFor & "%') " &_
"ORDER BY product_name "

SET RS = Conn.Execute( sqlString )
IF NOT RS.EOF AND searchFor <> "" THEN
%>
************************************************** ******************** Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &

ASP.NET resources...
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Barbara White | last post by:
Are meta tags case sensitive or does case sensitivity vary depending on the search engine a user is using? I've read that some search engines care about case wrt meta tags (for keywords in...
3
by: Barbara White | last post by:
Are meta tags case sensitive or does case sensitivity vary depending on the search engine a user is using? I'm wondering whether there's a standard regarding case (and other rules) in meta tags...
3
by: adrian suri | last post by:
Hi short question are selectors h1, h2 <script> p etc now case sensitive in the world of DHTML eg transitional / strict regards Adrian
1
by: ericswebber | last post by:
Case Insensitive Search with Sensitive Replace -------------------------------------------------------------------- Need a REGEX case insensitve search & replace where case of found string is...
4
by: Ike | last post by:
If I have a field, `lastname`, and in the WHERE predicate of my SELECT statement I want to test if it is LIKE 'Smith' without regards to case (i.e. I want it to be true if it is smith or Smith or...
1
by: benhoefer | last post by:
I have been searching around and have not been able to find any info on this. I have a unique situation where I need a case sensitive map: std::map<string, intimap; I need to be able to run a...
4
by: bb | last post by:
Hi, void fun(const std::map<std::string,int>& m1) { // How to make a case insensitive search of this map without making a copy? } cheers.
0
by: Ethan Furman | last post by:
Maric Michaud wrote: Actually, the OP said: -- So you're saying to ensure that stage_map's keys are initially -- lower-case to begin with? Well, I can't do this either since the -- *case of the...
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.