Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

How to search for more than one word?

I created a search form for our chamber of commerce at www.sodachamber.com which works with one word searches. How do I make it work with more than one word or just part of the words visitors type in?
  Are there any good online tutorials or books that teach detailed ASP database programming with FrontPage 2003?
0
annyearsley
Asked:
annyearsley
  • 3
  • 2
1 Solution
 
rcmbCommented:
Is the search searching the entire site or a database?
0
 
annyearsleyAuthor Commented:
Just the database. I am using Atomz as a entire site search.
0
 
rcmbCommented:
In your SQL statement all you need to do is have the statement read WHERE SearchField LIKE '%::FieldName::%'

This is a contains statement which will find the following:

If you enter the word "at" it would return

Bat
Hat
Attic
What
Cathy

Try this and let me know how it works for you.

RCMB
0
 
annyearsleyAuthor Commented:
Yes, it does work that way. It will pick part of any word out but won't work if you type in two words, even if one word matches. Thanks!
0
 
rcmbCommented:
If you desire to search for two words then put in a second text box on your search form and change your query to look like:

WHERE (SearchField1 LIKE '%::FieldName::%' OR SearchField2 LIKE '%::FieldName::%')

Otherwise we are going to have to get away from frontpage wizards and use VBScript to write the code.

RCMB
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now