%@ LCID = 3081 %> <% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.addHeader "cache-control", "no-cache" Response.addHeader "cache-control", "no-store" Response.CacheControl = "no-cache" %> <% ewCurSec = 0 ' Initialise ' User levels Const ewAllowAdd = 1 Const ewAllowDelete = 2 Const ewAllowEdit = 4 Const ewAllowView = 8 Const ewAllowList = 8 Const ewAllowReport = 8 Const ewAllowSearch = 8 Const ewAllowAdmin = 16 %> <% ' Initialize common variables x_EVENT_CODE = Null: ox_EVENT_CODE = Null x_EVENT_NAME = Null: ox_EVENT_NAME = Null x_EVENT_TEXT = Null: ox_EVENT_TEXT = Null x_DATE_START = Null: ox_DATE_START = Null x_DATE_END = Null: ox_DATE_END = Null x_VENUE_CODE = Null: ox_VENUE_CODE = Null x_VENUE_STATE = Null: ox_VENUE_STATE = Null x_SEATS_AVAILABLE = Null: ox_SEATS_AVAILABLE = Null x_SEATS_SOLD = Null: ox_SEATS_SOLD = Null x_PRICE = Null: ox_PRICE = Null x_DFRECNUM = Null: ox_DFRECNUM = Null %> <% Response.Buffer = True ' Load Key Parameters sKey = "": bSingleDelete = True x_EVENT_CODE = Request.QueryString("EVENT_CODE") If x_EVENT_CODE <> "" Then If sKey <> "" Then sKey = sKey & "," sKey = sKey & x_EVENT_CODE Else bSingleDelete = False End If If Not bSingleDelete Then sKey = Request.Form("key_d") End If If sKey = "" Or IsNull(sKey) Then Response.Redirect "EVENTSlist.asp" arRecKey = Split(sKey&"", ",") i = 0 Do While i <= UBound(arRecKey) sDbWhere = sDbWhere & "(" ' Remove spaces sRecKey = Trim(arRecKey(i+0)) ' Build the SQL sDbWhere = sDbWhere & "[EVENT_CODE]='" & AdjustSql(sRecKey) & "' AND " If Right(sDbWhere, 5) = " AND " Then sDbWhere = Left(sDbWhere, Len(sDbWhere)-5) & ") OR " i = i + 1 Loop If Right(sDbWhere, 4) = " OR " Then sDbWhere = Left(sDbWhere, Len(sDbWhere)-4) ' Get action sAction = Request.Form("a_delete") If sAction = "" Or IsNull(sAction) Then sAction = "I" ' Display record End If ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str Select Case sAction Case "I": ' Display If LoadRecordCount(sDbWhere) <= 0 Then conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "EVENTSlist.asp" End If Case "D": ' Delete If DeleteData(sDbWhere) Then Session("ewmsg") = "Delete Successful" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "EVENTSlist.asp" End If End Select %>
Delete from TABLE: EVENTS
Back to List