如何删除多项选择的记录?

chenypluck 2003-11-07 03:00:55
在类似邮箱收件箱的界面里,容许多项选择,当只选择了一项时,删除没有问题。可是当选择多项时,就出错了。请问该怎么办呢 ?
...全文
43 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenypluck 2003-11-07
  • 打赏
  • 举报
回复
谢谢 了
tigerwen01 2003-11-07
  • 打赏
  • 举报
回复
使用For Each ... in...循环:
<%
dim reID,strreID
strreID=""
strSQL=""
For Each strreID In Request("checkbox")
reID=Cint(strreID)
if strreID<>"" then
oConn.Execute "Delete From Table where ID="&reID
strreID=""
%>
xiejunhua 2003-11-07
  • 打赏
  • 举报
回复
用checkbox存入id号
<input name="checkboxid" type="checkbox" value="<%=rs("id")%>">

删除页
checkboxid=request("checkboxid")
if checkboxid<>"" then
conn.execute "delete from [tablename] where id in ("&checkboxid&")"
response.Redirect "****.asp" '导向删除成功后页面
response.End
else
response.Write("<script>alert('未选删除项');window.history.back();</script>")
end if
aryou 2003-11-07
  • 打赏
  • 举报
回复
delete from table1 where id in all

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧