Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Checkboxes to create a dynamic SQL query
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Checkboxes to create a dynamic SQL query

 Post Reply Post Reply
Author
jdumayas View Drop Down
Newbie
Newbie
Avatar

Joined: 19 February 2003
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote jdumayas Quote  Post ReplyReply Direct Link To This Post Topic: Checkboxes to create a dynamic SQL query
    Posted: 04 March 2003 at 2:41pm
Hello, I'm needing a bit of help to set up an SQL query that is generated from a check box form.

Background on the DB:

tblTechnologyLookup
OfferingID, TechnologyID, RoleID

tblOfferings
offeringID, offeringTitle

What I have is a form with checkboxes where each checkbox is named by the technologyID or roleID (<INPUT TYPE="checkbox" NAME="[technologyID]" value="1">). I've called this page prescriptionbuilder.asp.

When users click on the various roles and technologies that they want to search and hit the submit button, I need the page that the form posts to, (perscrption.asp), to return the search results. At a minimum the user could click on one role and one technology. The total number of possible roles is 5 and the current number of technologies is 233.

I'm new to asp and vbscript, I need to know how to set up perscription.asp to query the DB.

Any assistance would be greatly apprecitated. Thanks for all of your help. Jeremy
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 04 March 2003 at 2:58pm

You are planning to compine 233 OR or AND statements in a SQL query? Do you have that many checkboxes there. I would not let the user select that many, If you have 5 Roles let the user only select a few technologies, he can always come back to select others. Then on the actual page you just create a loop going through the form items building up your query.

Back to Top
jdumayas View Drop Down
Newbie
Newbie
Avatar

Joined: 19 February 2003
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote jdumayas Quote  Post ReplyReply Direct Link To This Post Posted: 04 March 2003 at 3:42pm

What code would I use to send the variables to the page that returns the query?  Since I've only worked with sending one variable (ID number), I'm having a hard time trying figuring out how to send more than one.  Thanks for your help.

 

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 04 March 2003 at 7:36pm
al form fields wiyhin a form get transmitted to the action page if that is what you are asking. your problem will be generating the query. figure out how you want to select the user what first.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.