I have a asp file which contain all recordset from access database in a table (List Products.asp). At each row there is a link which will open another file (Update Product.asp). The open file will contain record that is selected from List Products.asp.
So, how to get the selected record from List Products.asp appear on Update Product.asp. It will appear in a text box for each field.
Here what is contain in database.
Table: Products
Field: Product ID, Product Name, Product Price
Below is code for List Products.asp
- <%language="javascript"%>
-
<html>
-
<body>
-
<% var DSN="DSN=Bakery";
-
var Conn = Server.CreateObject("ADODB.Connection");
-
Conn.Open(DSN);
-
-
sql="SELECT * from Products";
-
rs=Server.CreateObject("ADODB.Recordset");
-
rs.Open(sql,Conn);
-
-
out+="<table border=1>"
-
out +="<tr><td>Product ID</td><td>Product Name</td><td>Price</td></tr>";
-
-
while(!(rs.EOF))
-
{
-
out +="<tr><td><%rs("Product ID")%></td><td><%rs("Product Name")%></td><td><%rs("Product Price")%></td><td><a href="Update Product.asp"></a></td></tr>"
-
-
rs.move(1);
-
}
-
-
out +="</table>"
-
rs.Close();
-
Response.write(out);
-
-
%>
-
</body>
-
</html>
-
-
I need help to create the sql for Update Product.asp and how to transfer record from List Products.asp to Update Product.asp