Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Search query help

    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.
    Code:
    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>"

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    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-de...tlistboxes.asp
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the help, I'll try it out and let you how it goes.

  • #4
    New Coder
    Join Date
    Aug 2005
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I used
    Code:
    <input type="hidden" name="productset" value="Marvel">
    and it works perfectly, thank you for the help.

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    You're welcome and glad it worked!
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •