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 December 27th, 2004, 04:45 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Search Does not go beyond 1st word in field

Hi All,

I have 2 fields in SQL 2000 Database, called "Fields_of_interest" and "Name." Users input their data into them. What I want to do is be able to search on the "fields_of_interest" field. So for example, I have two records inputed.

Name: Fields_of_interest:
Leon security, IT, programmer
John security, accounting,

Here is the problem. In an ASP "search" page that I have created, when I do a search, I can ONLY search on the first word of the "Fields_of_interest" field. In other words, let say I want to search for someone who is interested in Accounting. I will get a NO record result, because the query is not looking for anything beyond the first word in the field. Any idea why it is doing this? Below is my query.

mySQL="SELECT ApplicantID, firstname, lastname, email, start_date, end_date, fields_of_interest, academic_level, academic_goals, career_goals FROM internship_form where isArchive=1"

mySQL=mySQL & " AND fields_of_interest like '" & fields_of_interest & "%'"
 
Old December 27th, 2004, 06:10 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this:

mySQL="SELECT ApplicantID, firstname, lastname, email, start_date, end_date, fields_of_interest, academic_level, academic_goals, career_goals FROM internship_form where isArchive=1"

mySQL=mySQL & " AND fields_of_interest like '%" & fields_of_interest & "%'"
 
Old December 27th, 2004, 08:11 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Shahchi1, this work! thanks!

Leon






Similar Threads
Thread Thread Starter Forum Replies Last Post
Search certain word using XML deean XML 16 June 12th, 2008 05:57 AM
Word search - Count Hits bonekrusher XSLT 5 January 2nd, 2008 10:26 AM
Populate field names upon selection from 1st DDL? InsouciantCoquette Classic ASP Databases 0 February 26th, 2006 11:23 PM
How to highlight search results in Word haiying Access VBA 0 July 25th, 2005 11:13 AM





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