home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
bombers.k12.ar.us
/
bombers.k12.ar.us.tar
/
bombers.k12.ar.us
/
survey
/
DeleteLibrary.asp
< prev
next >
Wrap
Text File
|
2006-11-29
|
2KB
|
49 lines
<!--#Include File="Include/Top_inc.asp"-->
<%
'***********************************************************************
' Application: SelectSurveyASP Advanced v8.1.11
' Author: Aaron Baril for ClassApps.com
' Page Description: This page deletes a library, and then redirects the
' user back to the list of libraries.
'
' 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"-->
<%
'In order to delete the library, the user must be the library owner or must be an admin
If IsUserLibraryOwner(Request.QueryString("LibraryID")) = False And lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
Response.Redirect "AccessDenied.asp?SurveyID=" & Request.QueryString("SurveyID") & "&Reason=" & SUR_ACCESS_DENIED_NOT_LIBRARY_OWNER
End If
Dim strSQL
Dim conDelete
'Initialization
Set conDelete = Server.CreateObject("ADODB.Connection")
conDelete.Open SURVEY_APP_CONNECTION
'Delete all items from the mapping table (SUR_LIBRARY_TO_ITEM_MAPPING)
strSQL = "DELETE FROM sur_library_to_item_mapping WHERE library_id = " & Request.QueryString("LibraryID")
conDelete.Execute ConvertSQL(strSQL), , adCmdText
'Delete the library from the library table (SUR_LIBRARY)
strSQL = "DELETE FROM sur_library WHERE library_id = " & Request.QueryString("LibraryID")
conDelete.Execute ConvertSQL(strSQL), , adCmdText
'Clean up
conDelete.Close
Set conDelete = Nothing
'Redirect to the main list of libraries
Response.Redirect "LibraryList.asp"
%>