<% Option Explicit %> <% 'Set the response buffer to true as we maybe redirecting Response.Buffer = True 'Dimension variables Dim rsListMembers 'Database Recordset Variable Dim intRecordPositionPageNum 'Holds the record position Dim intRecordLoopCounter 'Loop counter for displaying the records Dim intTotalNumEntries 'Holds the total number of records in the database Dim intTotalNumPages 'Holds the total number of pages in the database Dim intLinkPageNum 'Holds the page number to be linked to 'If the session variable is False or does not exsist then redirect the user to the unauthorised user page If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then 'Redirect to unathorised user page Response.Redirect"unauthorised_user_page.htm" End If 'If this is the first time the page is displayed then the record position is set to page 1 If Request.QueryString("PagePosition") = "" Then intRecordPositionPageNum = 1 'Else the page has been displayed before so the record postion is set to the Record Position number Else intRecordPositionPageNum = CLng(Request.QueryString("PagePosition")) End If 'Create recorset object Set rsListMembers = Server.CreateObject("ADODB.Recordset") 'Initalise the strSQL variable with an SQL statement to query the database by selecting all tables ordered by the decending date strSQL = "SELECT tblMailingList.* FROM tblMailingList ORDER BY tblMailingList.Email ASC;" 'Set the cursor type property of the record set to dynamic so we can naviagate through the record set rsListMembers.CursorType = 3 'Query the database rsListMembers.Open strSQL, adoCon 'Set the number of records to display on each page by the constant set at the top of the script rsListMembers.PageSize = 40 'Get the record poistion to display from If NOT rsListMembers.EOF Then rsListMembers.AbsolutePage = intRecordPositionPageNum %> Remove Mailing List Members
Remove Mailing List Members
Return to the Mailing List menu Menu
<% 'If there are no records in the database display an error message If rsListMembers.EOF Then 'If the page position is not 1 and were at the end of the recordset then redirect to the first page If intRecordPositionPageNum > 1 Then Response.Redirect "delete_list_members_form.asp?PagePosition=1" 'Tell the user there are no records to show Response.Write "There are no records in the database" Response.Write "
Please check back later" Response.End 'Display the Else 'Count the number of enties in the database intTotalNumEntries = rsListMembers.RecordCount 'Count the number of pages there are in the database calculated by the PageSize attribute set above intTotalNumPages = rsListMembers.PageCount 'Display the HTML number number the total number of pages and total number of records in the database Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & "
" Response.Write vbCrLf & " Place a tick in the check box of the e-mail address you wish to remove

" Response.Write vbCrLf & " There are " & intTotalNumEntries & " mailing list members in " & intTotalNumPages & " pages and your are on page number " & intRecordPositionPageNum Response.Write vbCrLf & "
" Response.Write vbCrLf & "
" ' loop through the records in the database and show the infomation ' using a Do While...Loop statement For intRecordLoopCounter = 1 to 40 'If there are no records left to display then exit loop If rsListMembers.EOF Then Exit For 'Display the e-mail's in HTML Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & "
" & rsListMembers("Email") & "
" ' Move to the next record rsListMembers.MoveNext Next End If %>
Check Box's to delete Mailing List Members

<% 'Display an HTML table with links to the other entries in the Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & "
" Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & " " Response.Write vbCrLf & "
" 'If there are more pages to display then add a title to the other pages If intRecordPositionPageNum > 1 or NOT rsListMembers.EOF Then Response.Write vbCrLf & " Page:  " End If 'If the page number is higher than page 1 then display a back link If intRecordPositionPageNum > 1 Then Response.Write vbCrLf & " << Prev   " End If 'If there are more pages to display then display links to all the pages If intRecordPositionPageNum > 1 or NOT rsListMembers.EOF Then 'Display a link for each page in the For intLinkPageNum = 1 to intTotalNumPages 'If the page to be linked to is the page displayed then don't make it a hyper-link If intLinkPageNum = intRecordPositionPageNum Then Response.Write vbCrLf & " " & intLinkPageNum Else Response.Write vbCrLf & "  " & intLinkPageNum & "  " End If Next End If 'If it is Not the End of the entries then display a next link for the next page If NOT rsListMembers.EOF then Response.Write vbCrLf & "  Next >>" End If 'Finsh HTML the table Response.Write vbCrLf & "
" Response.Write vbCrLf & "
" 'Reset Sever Objects Set adoCon = Nothing Set strCon = Nothing Set rsListMembers = Nothing %>