Print Page | Close Window

13 options search

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=4022
Printed Date: 30 March 2026 at 4:52am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: 13 options search
Posted By: jellejacob
Subject: 13 options search
Date Posted: 03 July 2003 at 3:04am

Hi everybody,

I'm trying to build a searchpage on which a user can select 13 possible options including 3 between options and a keyword field for searching the whole table.

Is anyone familiar with a searchpage of this kind and what's the "best" way of doing this? Do I have (or not) to pre-code all the possible combinations/options with AND's or OR's?

I hope someone can give me a kick in the right direction.

Thanks in advance




Replies:
Posted By: ultramods
Date Posted: 03 July 2003 at 8:55am

Try

Dim sql, keyword, sql3

sql = "SELECT * FROM YOUR TABLE"

sql3=""

'then read in form data

keyword = Trim(Request.Form("keyWord")

IF keyWord <> "" THEN

 sql2 = sql2 &  " keyword=' " & keyWord & " ' AND"

END IF

'Then once you have got all the form data etc(if any)

IF sql3 <> "" THEN

'get rid of the last and in the string                                             sql3 = Left(sql3, Len(sql3)-4)

sql = sql & " WHERE " & sql3

END IF

This is very basic, but you can build it up




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net