|
|
|
|
|
| | |
|
Active Server Pages asp source code database MS SQL MS Access .mdb adovbs.inc cookies calendar codes sql commands scripts asp programming tutorials iis web server components CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: ASP and SQL - Please help |
From: |
wanker8000 |
Date: |
8/29/2001 10:00:22 AM |
IP: |
65.105.120.2 |
I would just add on an addition statement to the where clause if the number of doors was specified by the user.
<%
dim sSQL, sSelect
sSelect = Request.QueryString("selNumDoors")
sSQL = "SELECT * FROM CARS " _
& "WHERE CAR_MAKE = 'AUDI'"
'whatever your non-response code is:
if sSelect <> "no_preference"
sSQL = sSQL & " AND NUM_DOORS = " & sSelect
end if
%>
...in the case where the number of doors wasn't specified, the less-restrictive SQL statement will be used and you'll get all the AUDIs.
-w8k |
Previous Message
|
|
|
|
|
|
|
|
|
|
|
|