asp加个按钮执行批量删除,还差个语句,请教

来源:百度知道 编辑:UC知道 时间:2024/06/06 04:42:45
http://www.homerun.com.cn/1.txt

response.Write("<TR class='tr1'><TD HEIGHT=20 align='center' colspan='11'>"&vbcrlf)
response.Write("<INPUT onClick='CheckAll(this.form)' type='button' value='全 选' name='chkall'style='cursor: hand'>"&vbcrlf)
response.Write("<INPUT onClick='CheckOthers(this.form)' type='button' value='反 选' name='chkOthers'style='cursor: hand'>"&vbcrlf)
response.Write("<input onclick=window.location='mssk.asp?p="&pa&"&a="&a&"&w="&w&"&n="&n&"&t="&t&"&c="&c&"&j="&j&"&fb="&fb&"&fe="&fe&"&m="&m&"&z="&z&"'; type='reset' value='刷 新'> <INPUT type=submit value='批量添加资料

刚才没注意你上面那个网址
改这行:response.Write("<form name=forms method=post action="?action=del">"&

修改这部分代码
=================
id=trim(request("id"))
rs.open"select * from m_o where m_id="&id&"",conn,2,2
if not rs.eof and not rs.bof then
rs.delete
rs.update
end if
rs.close
conn.close
set conn=nothing

==================
为:
------------------------------
ID=trim(request("id"))'id是你的checkbox的名字
num=split(ID,",")
for each anyelement in num
Set rs = Server.CreateObject("ADODB.Recordset")
Sql="select * from m_o where m_id="&anyelement
rs.open sql,conn,1,3
rs.delete
rs.update
rs.close
set rs=nothing
-------------------
你试下是不是对的