thanks a lot!
but may i ask another help related to this. First i created a view page that displays all the data then recordID has a link to edit a particular record. But once i clicked the link for that particular recordID "The page cannot be found" displayed on the page. I don't know the reason.
Below is my code for the edit.asp
----------------------------------------------------------------------------------
set conn = server.createobject("adodb.connection")
conn.open ConString
set rs = server.createobject("adodb.recordset")
theID = Request.QueryString("id")
strSQL = "SELECT * FROM tblsam WHERE recordID=" & theID & ";"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQL, conn, adOpenKeyset, adLockOptimistic, adCmdText
If Not rs.EOF Then
%>
<form action="save.asp" method="post">
<p> <input type="hidden" name="id" value="<%= rs.Fields("recordID").Value %>" />
</p>
<TABLE BORDER="1" CELLPADDING="0" CELLSPACING="0" STYLE="border-collapse: collapse" BORDERCOLOR="#111111" WIDTH="80%" ID="AutoNumber4" ALIGN="CENTER">
<TR>
<TD WIDTH="33%"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" STYLE="border-collapse: collapse" BORDERCOLOR="#111111" WIDTH="100%" ID="AutoNumber5" HEIGHT="85">
<TR>
<TD > Last Name: </TD>
<TD > <INPUT NAME="last_name" VALUE="<%= Server.HTMLEncode(rs.Fields("last_name").Value) %>">
</TD>
</TR>
<TR>
<TD > First Name: </TD>
<TD > <INPUT NAME="first_name" VALUE="<%= Server.HTMLEncode(rs.Fields("first_name").Value) %>">
</TD>
</TR>
<TR>
<TD > Data: </TD>
<TD ><INPUT NAME="sales" VALUE="<%= Server.HTMLEncode(rs.Fields("sales").Value) %>">
</TD>
</TR>
</TABLE></TD>
</TR>
</TABLE>
<p> </p><p><br />
</p></form><%
Else
Response.Write "No record!"
End If
rs.Close
Set rs = Nothing%>
-------------------------------------------------------------------------
please check. Thanks.