ASP批量修改记录无法循环
程序执行成功,但是只能更新第一条记录,后面的记录全清除为空白了!请高手帮下忙!执行程序:<!--#includefile="conn.asp"--><bodybgcolo...
程序执行成功,但是只能更新第一条记录,后面的记录全清除为空白了!
请高手帮下忙!
执行程序:
<!--#include file="conn.asp"-->
<body bgcolor="#FFFFFF" text="#000000" >
<%
dim id
id=request.Form("id")
nid=split(id,",")
eid=ubound(nid)
for i=0 to eid
dim rs,sql
set rs=server.CreateObject("adodb.recordset")
sql="select * from study where id="&nid(i)
rs.open sql,conn,3,3
rs("b_fs")=request.Form("b_fs"&nid(i))
rs("b_wj")=request.Form("b_wj"&nid(i))
rs.update
rs.close
set rs=nothing
next
conn.close
set rs=nothing
response.write("<center>修改成功!<br></center>")
%>
提交程序一部分:
<form action=abc.asp method=post>
<table>
<%
do while not rs.eof
%>
<tr><td align=center ><input type=text name="b_fs<%=id%>" maxlength=4 class=i value="<%=b_fs%>" size="5">
</td>
<td align=center > <input type=text name="b_wj<%=id%>" maxlength=4 class=i value="<%=b_wj%>" size="5">
<input name="id" type="hidden" value="<%=id%>">
</tr></table>
<%
rs.movenext
loop
%>
<% rs.close
set rs=nothing
conn.close
set conn=nothing
%> 展开
请高手帮下忙!
执行程序:
<!--#include file="conn.asp"-->
<body bgcolor="#FFFFFF" text="#000000" >
<%
dim id
id=request.Form("id")
nid=split(id,",")
eid=ubound(nid)
for i=0 to eid
dim rs,sql
set rs=server.CreateObject("adodb.recordset")
sql="select * from study where id="&nid(i)
rs.open sql,conn,3,3
rs("b_fs")=request.Form("b_fs"&nid(i))
rs("b_wj")=request.Form("b_wj"&nid(i))
rs.update
rs.close
set rs=nothing
next
conn.close
set rs=nothing
response.write("<center>修改成功!<br></center>")
%>
提交程序一部分:
<form action=abc.asp method=post>
<table>
<%
do while not rs.eof
%>
<tr><td align=center ><input type=text name="b_fs<%=id%>" maxlength=4 class=i value="<%=b_fs%>" size="5">
</td>
<td align=center > <input type=text name="b_wj<%=id%>" maxlength=4 class=i value="<%=b_wj%>" size="5">
<input name="id" type="hidden" value="<%=id%>">
</tr></table>
<%
rs.movenext
loop
%>
<% rs.close
set rs=nothing
conn.close
set conn=nothing
%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询