473,545 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_descrip tion, product_price " &_
"FROM Products " &_
"WHERE product_status = 1 " &_
"AND ( product_name LIKE '%" & searchFor & "%' " &_
"OR product_descrip tion 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 1609
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******** *****@TK2MSFTNG P10.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_descrip tion,
product_price " &_
: "FROM Products " &_
: "WHERE product_status = 1 " &_
: "AND ( product_name LIKE '%" & searchFor & "%' " &_
: "OR product_descrip tion 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_n ame) LIKE '%" & ucase(searchFor ) & "%' " &_
"OR UPPER(product_d escription) 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******** *****@TK2MSFTNG P10.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_descrip tion, product_price " &_ "FROM Products " &_
"WHERE product_status = 1 " &_
"AND ( product_name LIKE '%" & searchFor & "%' " &_
"OR product_descrip tion 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
8116
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 particular) and I've read that other search engines aren't case sensitive. Is this true? Is there a listing of which search engines pay attention to case...
3
3037
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 (meta data in general). I couldn't find anything definitive, but I could just be mis-searching. (Maybe I searched using the wrong case. :-) ...
3
1694
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
2157
by: ericswebber | last post by:
Case Insensitive Search with Sensitive Replace -------------------------------------------------------------------- Need a REGEX case insensitve search & replace where case of found string is mirrored in replacement string please. The above question is basically how does one perform a REGEX Case insensitve search and replace where the...
4
2604
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 SMITH) how can I specify this? Thanks, Ike
1
5495
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 find on this map with a case sensitive AND case insensitive search. I need to be able to change this dynamically during execution. Is this...
4
8149
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
363
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 keys is actually valuable* ***later on***. It's only for -- the purposes of this specific comparison operation that the case -- should be ignored....
11
6227
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 the app is concerned). The problem is, If someone makes a typo, they may get an unexpected error due accidentally calling the original attribute...
0
7486
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7932
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7776
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5347
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4965
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3456
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1905
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
729
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.