求助关于asp删除指定栏目,和栏目下的所有文章的代码
<!--#include file="conn.asp"--><%
Set rs=server.createobject("adodb.recordset")
sql="select * from news_class "
rs.open sql,conn,1,3
if rs.recordcount=1 then
Response.Write("<script>alert('当前只有一条记录,不能执行任何操作!');location.href='news_category.asp';</script>")
rs.close
Else
这个rs1是删除栏目下的文章但是执行不了,什么情况???貌似是个死循环,怎么改???
<--rs1开始
Set rs1=server.createobject("adodb.recordset")
sql1="select * from news"
rs1.open sql1,conn,1,3
rs1.movefirst
While Not rs1.eof
If rs1("category_id")=request.queryString("id") Then
rs1.delete
rs1.movenext
rs1.update
End If
wend
rs1.close
Set rs1=Nothing
rs1结束-->
rs是删除栏目
Set rs=server.createobject("adodb.recordset")
sql="select * from news_class where id=" &request.queryString("id")
rs.open sql,conn,1,3
rs.delete
rs.update
Response.Write("<script language='JavaScript'>alert('删除成功');window.location.href='news_category.asp';</script>")
End If
rs.close
Set rs=Nothing
conn.close
Set conn=nothing
%>