关于批量删除问题!
以下是部分代码,想实现根据CKBOX的选择,进行数据的删除。
(暂时无法实现,请帮忙看看,谢谢)
---------------------------
<%If Request.QueryString("action")="del" Then
Call userdel
Else
%>
<table width="500" border="1" cellpadding="0" cellspacing="0" align="center" class=TableBorder>
<tr height="22" valign="middle" align="center">
<th width="30" height="18">ID</th>
<th width="80">用户名</th>
<th width="81">密码</th>
<th width="105">权限</th>
<th width="127">操作</th>
<th width="88"><a href="main.asp">添加</a><br>
<a href="?action=del&id=<%=ll(0)%>" onclick="{if(confirm('确定删除吗?')){return true;}return false;}">删除</a></th>
</tr>
<%
Dim ll
Set ll = Conn.Execute("Select ID,name,password,quanx From yongh")
Do While Not ll.Eof
%>
<tr valign="middle" bgcolor="#FFFFFF" align="center" height="22">
<td width="30"><%=ll(0)%></td>
<td width="80"><a href="User_Edit.asp?id=<%=ll(0)%>" title="点击编辑"><%=ll(1)%></a></td>
<td width="81"><%=ll(2)%></td>
<td width="105"><%Select Case ll("quanx")
Case 1
Response.write("管理员")
Case 2
Response.write("总办")
Case 3
Response.write("工艺部")
Case 4
Response.write("设计部")
End Select%></td>
<td width="127"><a href="User_Edit.asp?id=<%=ll(0)%>">编辑</a> |
<input name="ckbox" type="checkbox" value=<%=ll("id")%>></td>
<td width="88"> </td>
</tr>
<%
ll.MoveNext
Loop
ll.Close
Conn.Close
Set ll=Nothing
Set Conn=Nothing
%>
</table>
</body>
<%End if%>
</html>
<%
Sub userdel
Dim id,dd
id = Request.QueryString("ckbox")
Set dd = Conn.Execute("Delete From yongh Where in ID = "&id)
Response.write "<script language='javascript'>alert('删除成功!');" & chr(13)
Response.write "window.document.location.href='admin_del.asp';</script>"
End Sub
%>