asp的form中批量提交与修改数据
一次只能修改1条数据,能否一次更新。附源码:
<form name="theForm" id="demo" method="post" onSubmit="return Validator.Validate(this)" action="savebj.asp?id=<%=rs2("学号")%>">
<tr align="center" bgcolor="#f2f8ff" height="24">
<td height="29" valign="middle" nowrap width="54">
<%if rs2("信息确认")=0 then%>
<img alt="未报名" src="images/m_news.gif" width="21" height="14">
<%else%><img alt="已报名" src="images/m_olds.gif" width="21" height="14">
<%end if%>
</td>
<td height="29" valign="middle" nowrap width="96"> <input name="Number" type="hidden" value='<%=rs2("学号")%>'>
<%=rs2("学号")%></td>
<td height="29" valign="middle" nowrap width="75"><%=rs2("姓名")%></td>
<td height="29" bgcolor="#f2f8ff" width="78"> <select name="易做图" datatype="Require" msg="未选择您的性别" size="1" width="98">
<option value="<%=trim(rs2("性别"))%>" selected><%=trim(rs2("性别"))%></option>
<option value="男">男</option>
<option value="女">女</option>
</select></td>
<td height="29" width="149"> <p align="center"><font>
<input name="certificate" type="text" datatype="IdCard" msg="身份证号码不正确" size="18" maxlength="18" value='<%=trim(rs2("身份证号"))%>'>
</font></td>
<td height="29" nowrap width="78"> <p align="center"><font color="#000000">
<select name="bmclass" datatype="Require" msg="输入报名类别" size="1">
<option value="<%=trim(rs2("报名类别"))%>" selected><%=trim(rs2("报名类别"))%></option>
<% dim sql3
sql3="select * from kslb"
set rs3 = conn.execute(sql3)%>
<%while not rs3.eof %>
<option value="<%= rs3(1)%>"><%=rs3(1)%></option>
<% rs3.movenext: wend: rs3.close %>
</select>
</font></td>
<td height="29" valign="middle" nowrap width="55"> <input type="submit" name="submit" value="报名"></td>
</tr>
<% rs2.movenext%>
</form>
savebj.asp:
dim id
id=request.QueryString("id")
id=split(id,",")
Username=request.form("Username")
易做图=request.form("易做图")
certificate=request.form("certificate")
bmclass =request.form("bmclass")
sql = "Select * From ksbm Where 学号='"&id(i)&"'"
set rs=CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
for i=0 to request.form("Username").count-1
rs("性别")=trim(split(易做图,",")(i))
rs("身份证号")=trim(split(certificate,",")(i))
rs("报名类别")=trim(split(bmclass,",")(i))
rs.update
rs.movenext
next
rs.close %> --------------------编程问答-------------------- 能修改1条数据,能否一次更新。附源码:
<form name="theForm" id="demo" method="post" onSubmit="return Validator.Validate(this)" action="savebj.asp?id= <%=rs2("学号")%>"> --------------------编程问答-------------------- 各国货币静默壁花 --------------------编程问答-------------------- 迷你版
补充:.NET技术 , ASP.NET