Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 8th, 2004, 05:41 PM
Registered User
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing values to query

I'd like to pass the value from a select box to a query, and have the query return a less than or equal to the selection
(HTML)
<select name="intPrice">
            <option value="all">All Price Levels
            <option value="100">Under $100</option>
            <option value="1000">Under $1000</option>
            <option value="10000">Under $10,000</option>
            <option value="100000">Under $100,000</option>
        </select>


(Where Clause on results page)
sqlText = sqlText & "where products.productPrice <= " & intPrice & " products.catalogID = " & strCat & ""

I think I'm close but any help is appreciated.

Just because you can, it doesn't mean you should
 
Old December 8th, 2004, 09:35 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,


sqlText = sqlText & "where products.productPrice <= " & intPrice & " products.catalogID = " & strCat & ""


Here, u r referring select control name directly(intPrice). It wont get any value like this. You must submit the form to the server and refer this control as request.form("intPrice")
This will return the value property of select control in which the item is selected.


-----------
Rajani

 
Old December 11th, 2004, 05:52 AM
Authorized User
 
Join Date: Dec 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
yes to rajini ..
as he said u can't use the name direct...
submit to the server...
and from there use request.from to accomplish your task...
bye for now...


MuthuKumar.AL





Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing multiple values to a pass- through query donnie200 Access VBA 2 July 7th, 2005 04:00 PM
Query Regarding passing Of Values gadhiav ASP.NET 1.0 and 1.1 Basics 5 July 16th, 2004 05:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.