Drop down menu SQL

eel_22

New member
Joined
Feb 10, 2003
Messages
1
I am currently building a small database driven website .

This website has a search function which firstly utilises javascript and drop down menus. i.e. the user selects from the 1st drop-down menu, which then populates the 2nd menu. The user then selects from this menu which then populates the third and final menu. User then selects from this and submits.

I want the nect page to take the information from each of the drop-down menu selections and search my MS access database for the available product.

The following is the code I have for my asp page which is for searching the DB

<HTML>
<TITLE> Search Results ------ BUY</TITLE>
<BODY>
<B>Here are the Products available:<B><BR>
<%

Get the variable from the drop down menu

Request.Querystring("firstChoice")
Request.Querystring("secondChoice")
Request.Querystring("thirdChoice")


build SQL statement - get from the MS Access DB all the details on the product selected in the drop-down menu

SQL_query = "SELECT * FROM products WHERE Flow_Cv = " & Request.Form("firstChoice") & " AND Orifice_size = " & Request.Form("secondChoice") & " AND Port_Connection = " & Request.Form("thirdChoice") & ""


Create connection name "MyConn"
Load the resulting recordset into the variable RS

Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open "FILEDSN=c:\dsn\MyProducts_dsn.dsn"

Set RS = MyConn.Execute(SQL_query)
WHILE NOT RS.EOF
%>

<%Response.Write "Product_id : " & rs("Product_id") & " "%> --------- Click here to BUY<BR><BR>

<%
RS.MoveNext
WEND
RS.Close
MyConn.Close
%>


</BODY>
</HTML>

I cant seem to get the sql query returning anything from my DB.

Anybody got any ideas?
 
This question is probably more appropriate for this sites sibling: http://www.visualbasicforum.com and the ASP forum specifically.

When Id have problems like this that didnt produce an error, Id just Response.Write the SQL string then copy and paste it into Access and make sure it *should* return results before you go too far in the error tracking process.
 
Back
Top