Database Results Criteria

S

Steve

Hi: I'm having trouble with the Database Results
Criteria. I have 3 fields that visitors can search by.
For 2 of them I want an exact match so I am using Equals
as the criteria. For a 3rd field, I want it so that if
the person enters part of the name (and leaves the other
2 fields blank), then the results from that match would
appear. EXAMPLE: If a person would enter Acme, then I
would want the person to see anything that would contain
Acme (such as Acme Manufacturing, Acme Insurance, etc).

HOWEVER, when I set up the criteria for "Like", then it
requires an Exact Match. If I would enter "Acme" when
the criteria is Like, I would get No Records Found. I
tried using Begins With and Contains, but that then lists
ALL records, not just the ones with Acme.

HELP!!!!

Thanks,
Steve
 
J

Jim Buyens

Howdy:

"Contains" ought to do what you want. If that's not
working, I suspect your problem lies with the other two
fields, especially if you're trying to ignore those fields
if blank.

If you need more detailed assistance, try this:

1. Switch to code view.
2. Starting from the top of the page, search for
the string s-sql=
3. Post the value of this parameter to this thread.
It should look something like this, although yours
will probably be longer:

s-sql="SELECT * FROM empnames WHERE (empname
LIKE '%::empname::%')"

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top