Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 23rd, 2004, 03:19 AM
Authorized User
 
Join Date: Oct 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to salman
Default Finding records containing similar text

I want to retrieve records from an Access database containing text given by the user in a text box. For example if i write 'asad' in the text box then all the records containing the text 'asad' will be displayed. I am using ASP with Access database.
I have used LIKE in the query but that won't work.
plz tell me how can i do this?

 
Old January 23rd, 2004, 06:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you are using the Jet OLEDB Provider, use % not * as a wildcard, eg:

strSQL = _
   "SELECT Field1, Field2, Field3 " & _
   "FROM myTable " & _
   "WHERE SearchField LIKE '%asad%'"

Cheers
Ken

Microsoft MVP - Windows Server (IIS)
www.adOpenStatic.com
 
Old November 29th, 2004, 12:13 PM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Ken,

Is there a simple way to make the search non case-sensitive?

Congratulations on your MVP by the way. Well done. I have bought the IIS book and it really is great.

Patrick

Quote:
quote:Originally posted by KenSchaefer
 If you are using the Jet OLEDB Provider, use % not * as a wildcard, eg:

strSQL = _
"SELECT Field1, Field2, Field3 " & _
"FROM myTable " & _
"WHERE SearchField LIKE '%asad%'"

Cheers
Ken

Microsoft MVP - Windows Server (IIS)
www.adOpenStatic.com
The earth has music for those who listen!
 
Old November 30th, 2004, 10:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Patrick,

The LIKE operator does that. Ken's solution should work the way you wanted.

Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in updating records & finding records naveed77 VB Databases Basics 1 January 16th, 2007 12:12 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM
VB SQL search similar records Derek_05 Access VBA 1 March 24th, 2006 08:19 PM
Finding Records Itzamna VB Databases Basics 3 June 7th, 2005 10:44 AM
finding total no. of records reshmisworld Classic ASP Databases 4 July 24th, 2003 06:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.