全选 alert('请选择删除项目!');location.href='delete.asp';" else if(request("check") "") then Command1__ddd = request("check") set Command2 = Server.CreateObject("ADODB.Command") Command2.ActiveConnection =conn Command2.CommandText = "delete from biao1 where id in ("& Replace(Command1__ddd, "'", "''") &")" Command2.CommandType = 1 Command2.CommandTimeout = 0 Command2.Prepared = true Command2.Execute() response.Redirect("delete.asp") end if end if %>[/i],Bullcn'Blog - 分享、交流、进步。" /> ASP删除多条记录 - Bullcn'Blog

ASP删除多条记录


<script language="javascript">
function del()
{
    if (confirm ("确定要删除吗?"))
      {window.location.href="delete.asp"}
else return false;
}
function CheckAll(form){for (var i=0;i<form.elements.length;i++){var e = form.elements[i];if (e.name != 'chkall')e.checked = form.chkall.checked;}}
</script>
</head>
<body>
<form action="delete1.asp" method="post" name="form" onsubmit="javascript:return del()">
<table width="32%" border="0" align="center" cellpadding="0" cellspacing="0">
<%do while not rs.eof%>
   <tr>
     <td width="50%"><%=rs("ming")%></td>
     <td width="50%"><input name="check" type="checkbox" id="check" value="<%=(rs.Fields.Item("id").Value)%>" /></td>
   </tr>
   <%rs.movenext
   loop%>
   <tr>
     <td> </td>
     <td><input type="submit" name="Submit" value="提交" />
       <input type="checkbox" name="chkall"   onclick="CheckAll(this.form)" />
       全选</td>
   </tr>
</table>
</form>

<!--#include file="conn.asp"-->
   <%
if request("check")="" then
    response.write"<script>alert('请选择删除项目!');location.href='delete.asp';</script>"
    else
    if(request("check") <> "") then
    Command1__ddd = request("check")
    set Command2 = Server.CreateObject("ADODB.Command")
    Command2.ActiveConnection =conn
    Command2.CommandText = "delete from biao1 where id in ("& Replace(Command1__ddd, "'", "''") &")"
    Command2.CommandType = 1
    Command2.CommandTimeout = 0
    Command2.Prepared = true
    Command2.Execute()
    response.Redirect("delete.asp")
    end if
    end if
     %>

文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: 删除
相关日志:
评论: 0 | 引用: 0 | 查看次数: 466
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 20 字 | UBB代码 关闭 | [img]标签 关闭