ASP Delete User Program

Source: Internet
Author: User

Site administrator can be based on the user's activities in the site and the legality of management, if the implementation is unbearable can delete the user, here is not to say is delete users can delete files, and so on, this is just a simple file program, see how you use it is your own business.
Sub DeleteUser ()
Dim Del_users,i,alluserid,del_username
Dim Rs
Del_users = Split (UserName, ",")
For i = 0 to UBound (del_users)
Del_username = Newasp.checkbadstr (Del_users (i))
Set Rs = Newasp.execute ("Select Userid,username from [nc_user] WHERE username= '" & Del_username & "")
If not (rs.eof and RS.BOF) Then
Alluserid = alluserid & Rs (0) & ","
Newasp.execute ("UPDATE nc_message SET delsend=1 WHERE sender= '" & Newasp.checkstr (Rs (1)) & "'")
Newasp.execute ("DELETE from Nc_message WHERE flag=0 and incept= '" & Newasp.checkstr (Rs (1)) & "")
Messenge = messenge & <li> User ("& del_username &") deleted successfully. </li> "
End If
Next
Set Rs = Nothing
If alluserid <> "" Then
If Right (alluserid,1) = "," Then Alluserid = Left (Alluserid,len (Alluserid)-1)
Newasp.execute ("DELETE from Nc_user WHERE userid" ("& Alluserid &"))
Newasp.execute ("DELETE from Nc_favorite WHERE userid" ("& Alluserid &"))
Newasp.execute ("DELETE from Nc_friend WHERE userid" ("& Alluserid &"))
End If
Status = 0
End Sub

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.