home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
bombers.k12.ar.us
/
bombers.k12.ar.us.tar
/
bombers.k12.ar.us
/
survey
/
DeleteEmailList.asp
< prev
next >
Wrap
Text File
|
2006-11-29
|
3KB
|
60 lines
<!--#Include File="Include/Top_inc.asp"-->
<%
'***********************************************************************
' Application: SelectSurveyASP Advanced v8.1.11
' Author: Aaron Baril for ClassApps.com
' Page Description: This page deletes an email list, and then redirects the
' user back to the user's list of email lists.
'
' COPYRIGHT NOTICE
'
' See attached Software License Agreement
'
' (c) Copyright 2002 - 2006 by ClassApps.com. All rights reserved.
'***********************************************************************
%>
<!--#Include File="Include/Config_inc.asp"-->
<!--#Include File="Include/Utility_inc.asp"-->
<!--#Include File="Include/adovbs_inc.asp"-->
<!--#Include File="Include/CurrentUser_inc.asp"-->
<!--#Include File="Include/SurveySecurity_inc.asp"-->
<!--#Include File="Include/Constants_inc.asp"-->
<%
'If the user does not have "Create" or "Admin" permission, redirect to the access denied page.
If lngUserSecurityLevel <> SUR_SECURITY_LEVEL_CREATE And lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
Response.Redirect "AccessDenied.asp?Reason=" & SUR_ACCESS_DENIED_NOT_ADMIN_SECURITY_LEVEL
End If
Dim strSQL
Dim conDelete
Dim lngEmailListID
'Initialization
Set conDelete = Server.CreateObject("ADODB.Connection")
conDelete.Open SURVEY_APP_CONNECTION
lngEmailListID = Request.QueryString("EmailListID")
'Delete all the entries from the email sent history table (SUR_EMAIL_SENT_HISTORY)
strSQL = "DELETE FROM sur_email_sent_history WHERE email_address_id IN (" & _
ConvertSQLInClause("SELECT email_address_id FROM sur_email_address WHERE email_list_id = " & lngEmailListID, "email_address_id") & ")"
conDelete.Execute ConvertSQL(strSQL), , adCmdText
'Delete all the entries from the address table (SUR_EMAIL_ADDRESS)
strSQL = "DELETE FROM sur_email_address WHERE email_list_id = " & lngEmailListID
conDelete.Execute ConvertSQL(strSQL), , adCmdText
'Delete the message history the message history table (SUR_EMAIL_MESSAGE)
strSQL = "DELETE FROM sur_email_message WHERE email_list_id = " & lngEmailListID
conDelete.Execute ConvertSQL(strSQL), , adCmdText
'Delete the email list from the email list table (SUR_EMAIL_LIST)
strSQL = "DELETE FROM sur_email_list WHERE email_list_id = " & lngEmailListID
conDelete.Execute ConvertSQL(strSQL), , adCmdText
'Clean up
conDelete.Close
Set conDelete = Nothing
'Redirect to the main list of email lists for the current user
Response.Redirect "EmailListList.asp"
%>