I am currently in the process of designing a small DB-driven website.
This website has a search function on the front page which allows users to select menus. i.e. The user selects from menu 1, Flow CV, which then populates the 2nd menu, Orifice size, with only products corresponindg to this. The user then selects from this menu and the 3rd menu is populated. Finally they select from this and then submit to an ASP page.
I have created this search function using javascript and arrays, the following is an example of the array I have created:
var arrItems1 = new Array();
var arrItemsGrp1 = new Array();
arrItems1[3] = “Orifice size A”;
arrItemsGrp1[3] = 1;
arrItems1[4] = “Orifice Size B”;
arrItemsGrp1[4] = 1;
arrItems1[5] = “Orifice Size C”;
arrItemsGrp1[5] = 1;
The ASP page takes the information from the drop down menus and searches the MS Access DB for the product, returning it to screen.
The following is some of the code in my asp page:
<%
‘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:dsnTestDB_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
%>
My problem is, that the asp page is loading but not returning any results from the DB. Has anybody any ideas on the problem????
I will try to supply as much info as possible if you need it.