<!--#include file="conn.asp"-->
<%if session("nyeee_uid")="" then
response.redirect "login.asp"
end if

dim theid,sql,rs
theid=request("id")
if isnumeric(theid)=false then
response.write "<script>alert('参数错误，关闭窗口！');window.close();</script>"
response.end
end if

sql="select * from nyeee_data where adid="&theid
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,3,2
if not rs.eof then
rs.delete
rs.update
rs.close  
set rs=nothing
sql="select * from nyeee_message where adid="&theid
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,3,2
if not rs.eof then
 For iPage = 1 To rs.recordcount
rs.delete
rs.update
rs.movenext     
if rs.eof then exit for
next
rs.close  
set rs=nothing
conn.close   
set conn=nothing
end if
response.write"<script>alert('删除成功！');location='listad.asp'</script>"
end if%>