Print Page | Close Window

Checkboxes to create a dynamic SQL query

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=728
Printed Date: 28 March 2026 at 9:01am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Checkboxes to create a dynamic SQL query
Posted By: jdumayas
Subject: Checkboxes to create a dynamic SQL query
Date 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



Replies:
Posted By: michael
Date 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.



Posted By: jdumayas
Date 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.

 



Posted By: michael
Date 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.



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