...

View Full Version : Search query help



mazer
09-13-2005, 11:19 AM
I'm totally new to SQL so please bare with me, I have a multiple dropdown menu search on my site and I want to replace one of the dropdown with a query that will select a specific product group which the customer can then search using the other two menus. I have managed to select the product group but when I delete the code for the dropdown it doesn't work anymore. Any help would be greatly appreciated.

strQuery = "SELECT * FROM Comics WHERE ProductGroup='Marvel';"
Set objRS = objConn.Execute(strQuery)
dropdown(0) = "<SELECT SIZE=1 NAME=productset>"
dropdown(0) = dropdown(0) & "<OPTION></OPTION>"
While NOT objRS.EOF
dropdown(0) = dropdown(0) & "<OPTION>" & objRS("ProductGroup") & "</OPTION>"
objRS.MoveNext
Wend
dropdown(0) = dropdown(0) & "</SELECT>"

Bullschmidt
09-14-2005, 03:33 AM
Well if other form fields are relying on this field perhaps with JavaScript or something then you can still keep the field without it being visible:

<input type="hidden" name="productset" value="Marvel">

Or:

<%
productset = "Marvel"
%>

<input type="hidden" name="productset" value="<%= productset %>">

And don't know if this link is related at all:

Classic ASP Design Tips - Dependent Listboxes
http://www.bullschmidt.com/devtip-dependentlistboxes.asp

mazer
09-14-2005, 02:03 PM
Thanks for the help, I'll try it out and let you how it goes.

mazer
09-14-2005, 02:27 PM
I used

<input type="hidden" name="productset" value="Marvel">
and it works perfectly, thank you for the help.

Bullschmidt
09-14-2005, 04:37 PM
You're welcome and glad it worked! :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum