%@ 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_VENUE_CODE = Null: ox_VENUE_CODE = Null x_CREDITOR_CODE = Null: ox_CREDITOR_CODE = Null x_VENUE_NAME = Null: ox_VENUE_NAME = Null x_ADDRESS_1 = Null: ox_ADDRESS_1 = Null x_ADDRESS_2 = Null: ox_ADDRESS_2 = Null x_ADDRESS_3 = Null: ox_ADDRESS_3 = Null x_ADDRESS_4 = Null: ox_ADDRESS_4 = Null x_POST_CODE = Null: ox_POST_CODE = Null x_COUNTRY = Null: ox_COUNTRY = Null x_PHONE_NUMBER = Null: ox_PHONE_NUMBER = Null x_FAX_NUMBER = Null: ox_FAX_NUMBER = Null x_CONTACT_NAME = Null: ox_CONTACT_NAME = Null x_EMAIL_ADDRESS = Null: ox_EMAIL_ADDRESS = Null x_ROOM_NAME = Null: ox_ROOM_NAME = Null x_DFRECNUM = Null: ox_DFRECNUM = Null %> <% Response.Buffer = True ' Load Key Parameters sKey = "": bSingleDelete = True x_VENUE_CODE = Request.QueryString("VENUE_CODE") If x_VENUE_CODE <> "" Then If sKey <> "" Then sKey = sKey & "," sKey = sKey & x_VENUE_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 "VENUESlist.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 & "[VENUE_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 "VENUESlist.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 "VENUESlist.asp" End If End Select %>
Delete from TABLE: VENUES
Back to List