|
-
February 10th, 2003, 02:19 PM
#1
advanced search form
Could someone please lead me in the right direction? I'm trying to create an advanced search form using ASP which searches an SQL db. The form has 7 seven different criteria which can be searched, but only one is required to get results. Not sure how to pass the variables to ASP and have it search the DB with one or only a few of the requirements. Thank you!
-
February 20th, 2003, 03:30 AM
#2
You have to make the options as boolean (true or false), then in the receiving function (or page) make a some if..then statementsthat forms the sql-query.
sql = "SELECT * FROM myTable where "
If option1=true then
sql = sql & "searchColumn = keyword"
end if
If option2=true then
sql = sql & " And searchColumn2 = keyword"
end if
.......
.......
......
then pass the string to Sql server.........
Staffy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|