Click to See Complete Forum and Search --> : How to search a database field from form input?


tekboy
01-24-2006, 07:39 PM
How to search a database field from form input?
i like to have a html form from an html page that will call an asp page to do db search, if user enter a zipcode that match in the database it will pull all the infomation from both talbes and display on the screen
if user enter first name or lastname or contact id will do search base on that

i have 2 tables related to each other
contact table
id, fname, lastname, contactid, email

zip table
id, zip, contactid, city

Bullschmidt
01-29-2006, 05:40 PM
Example of an inner join:

strSQL = "SELECT * FROM tblContact INNER JOIN tblZip ON tblContact.ContactID = tblZip.ContactID"

And perhaps this may hopefully give you some ideas:

Classic ASP Design Tips - Search Criteria on Multiple Fields
http://www.bullschmidt.com/devtip-searchcriteria.asp