Hi guys!
I was wondering if any of you guys would be able to help solve what is probably a simple problem....
I am using dreamweaver / asp/ access to create a dynamic web application. I have created a record set which queries the database and displays the results. The recordset searches for a product id which is inserted by the user, the product details are then displayed. I somehow can only get the first record in the database to display in the dynamic table. This record is not even searched for it is just there already when i preview the page in the browser then when I enter another ID nothing happens.
here is my code :-
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/dbtest.asp" -->
<%
Dim rs_search__MMColParam
rs_search__MMColParam = "1"
If (Request.Form("ProductID") <> "") Then
rs_search__MMColParam = Request.Form("ProductID")
End If
%>
<%
Dim rs_search
Dim rs_search_numRows
Set rs_search = Server.CreateObject("ADODB.Recordset")
rs_search.ActiveConnection = MM_dbtest_STRING
rs_search.Source = "SELECT * FROM product WHERE ProductID = " + Replace(rs_search__MMColParam, "'", "''") + " ORDER BY ProductID ASC"
rs_search.CursorType = 0
rs_search.CursorLocation = 2
rs_search.LockType = 1
rs_search.Open()
rs_search_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs_search_numRows = rs_search_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>search</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>Insert product ID you wish to search for:-
<form method="POST" name="formsearch" id="formsearch">
<table width="528" height="136" border="1">
<tr>
<td width="153">productID</td>
<td width="359"><input name="txtProductID" type="text" id="txtProductID" size="50"></td>
<td><input name="btnsearch" type="submit" id="btnsearch" value="search"></td>
</tr>
</table>
<input type="hidden" name="MM_search" value="formsearch">
</form>
<p> </p>
<table border="1">
<tr>
<td>ProductID</td>
<td>Product</td>
<td>Price</td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT rs_search.EOF)) %>
<tr>
<td><%=(rs_search.Fields.Item("ProductID").Value)%></td>
<td><%=(rs_search.Fields.Item("Product").Value)%></td>
<td><%= FormatCurrency((rs_search.Fields.Item("Price").Value), 2, -2, -2, -2) %></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs_search.MoveNext()
Wend
%>
</table>
</body>
</html>
<%
rs_search.Close()
Set rs_search = Nothing
%>
Any ideas would be greatly appreciated! Thanks!!! :)
GLT