<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/dbtest.asp" -->
<%
Dim rs_search__MMColParam
If (Request.Form("ProductID") <> "") Then
rs_search__MMColParam = Request.Form("ProductID")
ElseIf (Request.Form("ProductID") = "") Then
rs_search__MMColParam = "1"
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>
<p>results:-</p>
<table border="1">
<tr>
<td width="87">ProductID</td>
<td width="87">Product</td>
<td width="87">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><%=(rs_search.Fields.Item("Price").Value)%></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
%>