Database Search Results Help

G

Guest

Ok, I've been reading some posts to help me with returning data from an
Access DB to a results page; however, in the DB Results Wizard I can set a
search field for only one field. For example, if have a firstname, lastname,
and perhaps email, I'd like the user to be able to get a result coming from
any of the 3 fields, not just one field.

How do I do this please?
 
G

Guest

If the visitor fills in, say, a text box named txtSearch, then on page 2 of
the wizard you would choose Custom Query and code a SQL statement along the
lines of:

SELECT * FROM mytable WHERE (firstname LIKE '%::txtSearch::%') OR (lastname
LIKE '%::txtSearch::'%') OR (email LIKE '%::txtSearch::%')

Jim Buyens
Microsoft MVP
http://www.interlacken.com
Author of:
o--> Microsoft Visual Web Developer 2005 Express Edition: Build a Web Site
Now!
o--> Microsoft Office FrontPage 2003 Inside Out
o--> Microsoft Windows SharePoint Services Inside Out
o--> Faster Smarter Beginning Programming
 

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