I delete posts on the desktop

Source: Internet
Author: User
' Del.vbs
Option Explicit
Dim Message,result
Dim title,text1,text2
Message= "Please enter the ID of the post you want to delete"
Title= "Post deletion"
Text1= "You canceled the operation!" "
Result =inputbox (message,title, "Please enter ID to delete post")
If result = "" Then
WScript.Echo Text1
ElseIf isnumeric (Result) =false Then
WScript.Echo "Please enter the correct id!"
ElseIf Trim (CInt) <>trim (Result) Then
WScript.Echo "Please enter the correct id!"
Else
Dim result1
Result1=msgbox ("You are sure to delete the post" &result&vbcrlf& "This operation will delete the post itself and the post of all the child stickers", 48+1+256, "Click OK to delete, press Cancel to give up!" ")
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 >" &A Mp;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 "Delete Successful!"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.