Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old June 20th, 2003, 02:21 PM
Registered User
Join Date: Jun 2003
Location: , NY, .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL , List Boxes/Menu Boxes, DB's

I am sure this has been asked before...sorry if it has.

I am making a page that when you submit it, based upon static criteria in 3 seperate listboxes/menu boxes on the first page will produce a query to a second page with the results.

For example:
List Box 1 is name Letter, List Box 2 is age, List Box 3 is Gender...

Whatever you choose in the 3 boxes will give you the outcome on the second page. So based upon that criteria, if you chose Letter A, age of 22, Gender of Female... it would give you those results from an Access/MySQL DB. All names starting with the letter A who is 22 and is female.

I have never done anything like this and would like to get into the advance arena of this type of web design.

Can either someone help me with the code or give me a webpage which explains how this is done? I am not looking for handouts, but it's something that is driving me up a wall. ASP101 didn't seem to have anything and I am not familiar with other good sites. Any help would be great. Thanks.

BTW...does adding Pictures in a DB cause a quicker corruption in data in a DB?
  #2 (permalink)  
Old June 30th, 2003, 04:07 AM
arp arp is offline
Authorized User
Join Date: Jun 2003
Location: Mumbai, Maharashtra, India.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts

hi!! you can do it with following query to your database

consider you collect three values as follows

nameChar = Request.Form("Listbox_1")
age = Request.Form("Listbox_2")
gender = Request.Form("Listbox_3")

query will be as follows

"Select * from [TABLENAME] where [NAMECOLUMN]='"&nameChar&"%' and [AGECOLUMN]="& age&" and [GENDERCOLUMN]='"& gender&"'"

Here I considered age datatype as number

According example given by you it will be

"Select * from [TABLENAME] where [NAMECOLUMN]='A%' and [AGECOLUMN]=22 and [GENDERCOLUMN]='female'"

Similar Threads
Thread Thread Starter Forum Replies Last Post
LIST BOXES Vision G Access 10 May 27th, 2006 01:45 AM
List Boxes, Help! JeffGirard Access 17 August 22nd, 2005 01:31 PM
Dynamic Menu - Using multiple dropdown boxes Sebastiaan Javascript How-To 2 December 1st, 2003 05:36 AM
Dynamic Menu - Using multiple dropdown boxes Sebastiaan Classic ASP Basics 3 June 7th, 2003 06:38 AM

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