当前位置: 首页 > 图文教程 > 网络编程 > ASP > 我在桌面上删帖子

ASP
用asp执行DTC
利用ADODB.Stream使用浏览器下载服务器文件
应用数据库的唯一性约束并在asp中捕捉数据库的错误
用ASP编程控制在IIS建立Web站点
asp实现k线图(在线)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(7)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(6)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(5)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(4)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(3)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(2)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(1)
用文本+ASP打造新闻发布系统。几点补充
用文本+ASP打造新闻发布系统(五)新闻修改
用文本+ASP打造新闻发布系统(四)新闻删除
用文本+ASP打造新闻发布系统(三)新闻列表显示
用文本+ASP打造新闻发布系统(二)新闻添加
ASP作的剪包锤游戏
ASP注册表项目修改
构建稳定的服务器端组件的七个步骤

ASP 中的 我在桌面上删帖子


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 27 ::
收藏到网摘: n/a

'del.vbs
option explicit
dim message,result
dim title,text1,text2
message="请输入要删除帖子的ID"
title="帖子删除"
text1="你取消了操作!"
result =inputbox(message,title,"请输入要删除帖子的ID")
if result ="" then
Wscript.echo text1
elseif isnumeric(result)=false then
Wscript.echo "请输入正确的ID!"
ElseIf trim(cint(result))<>trim(result) then
Wscript.echo "请输入正确的ID!"
Else
dim result1
result1=msgbox("你确定要删除帖子"&result&vbcrlf&"这一操作将删除帖子本身及帖子的所有子贴",48+1+256,"按 确定 删除,按 取消 放弃!")
if result1=vbok then
dim conn
Set conn = Wscript.CreateObject("ADODB.Connection")
conn.Open"driver={sql server};server=111.111.111.111;uid=11;pwd=11;"&"database=11;"
dim sql,rs,sql2,rs2,sql3
sql="select rootid,deep,ordernum from bbs where mianid ="&cint(result)
set rs=conn.execute(sql)
if not rs.eof then
if rs(0)=0 then
sql3="delete bbs where rootid="&result&" or mianid= "&result
else
sql2="select top 1 ordernum from bbs where rootid="&rs(0)&" and deep<="&rs(1)&" and ordernum >"&rs(2)&"order by ordernum "
set rs2=conn.execute(sql2)
if not rs2.eof then
sql3="delete bbs where ordernum >="&rs(2)&" and ordernum < "&rs2(0)&" and rootid="&rs(0)
else
sql3="delete bbs where ordernum >="&rs(2)&" and rootid="&rs(0)
end if
end if
dim introws
conn.execute(sql3),introws
if introws >0 then
Wscript.echo "删除成功 !"
else
Wscript.echo "删除失败 !"
end if
else
Wscript.echo"你要删除的帖子不存在!"
End if
else
Wscript.echo "你放弃了删除!"
end if
end if