asp用复选框获取动态表单ID向数据库批量添加问题
隔壁老亦 2019-11-16 08:07:43 做了一个动态表单,前面添加了复选按钮,加上了文本域(如图),用于批量提交搜索内容到表tb_user中的tz列对应id中。处理页可以接受到前台页的id,以下是我的处理页代码:
请教1、前台页面的文本域怎么跟ID绑定?
2、后台可以接收到ID,可以做到批量删除,修改成批量写入出现UPDATE语法错误。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
datafile ="data/user.mdb" connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(""&datafile&"")
Set conn=Server.CreateObject("ADODB.Connection")
conn.open ConnStr
%>
<%
id=Trim(Request("Checkdel"))
if id="" then
response.write response.end
end if
id=split(id,",",-1,1)
for i=0 to UBound(id)
conn.execute("update tb_user set tz="&HitRate&" where id="&id(i))
next
Response.Redirect"index.asp"
conn.close
set conn=nothing
%>