用ASP修改数据库记录问题,求教中
本人刚学ASP 现在做了个简单记录库存的页面,格式为,名称,数量,文本域,修改按钮。找了很多资料没弄懂如果在文本域输入新库存后点击按钮修改,请帮忙看一下。还有之前做了个颜色区分,在循环里有两个文本域和按钮,他们的ID都是相同的,不知道这样是否可以。
<!-- #include file= "db.inc.asp " -->
<%
exec= "select * from kucun "
set rs=server.createobject( "adodb.recordset ")
rs.open exec,conn,1,1
%>
<html>
<div align= "center ">
<table width= "25% " border= "1 " cellpadding= "0 " cellspacing= "0 " lang= "ar ">
<td width= "8% " align= "center " bgcolor= "#FFFFCC "> 名称 </td>
<td width= "6% " align= "center " bgcolor= "#FFFFCC "> 数量 </td>
<td width= "12% " align= "center " bgcolor= "#FFFFCC "> 修改 </td>
</tr>
<%dim i
i=0
do while not rs.eof
if i mod 2 =0 then
%>
<td> <center>
<%=rs( "k_f ")%>
</center> </td>
<td> <center>
<%=rs( "k_k ")%>
</center> </td>
<td>
<center> <input name= "f_k " type= "text " id= "f_name " size= "4 " maxlength= "3 "/>
<input name= "Submit1 " type= "submit " id= "Submit1 " value= "修改 ">
</center> </td>
</tr>
<%
else
%>
<tr bgcolor= "#990000 ">
<td bgcolor= "#FFFFCC "> <center>
<%=rs( "k_f ")%>
</center> </td>
<td bgcolor= "#FFFFCC "> <center>
<%=rs( "k_k ")%>
</center> </td>
<td bgcolor= "#FFFFCC "> <center> <input name= "f_k " type= "text " id= "f_name " size= "4 " maxlength= "3 "/>
<input name= "Submit1 " type= "submit " id= "Submit1 " value= "修改 ">
</center> </td>
</tr>
<%
end if
rs.movenext
i =i +1
loop
set rst=nothing
conn.close
set conn=nothing
%>
</table>
</html>
名称,数量,文本域,修改按钮