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 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?