<% On Error Resume Next If Request("Clicked") <> "" Then If Request("PageIndex") > Request("mxp") Then Response.redirect "records.asp?PageIndex=" & Request("curpag") & "&mxp=" & Request("mxp") End If End If Dim PageIndex, RecordsPageSize, MaxPages,TotalRecords RecordsPageSize = 4 PageIndex = Request("PageIndex") if PageIndex = "" then PageIndex = 1 End if %> Record Nevigation <% '------- added to delete junk post --------- db_path1 = Server.Mappath("cable.mdb") Set db_conn1 = Server.CreateObject("ADODB.Connection") db_conn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db_path1 & ";" StrSQL = "DELETE FROM guestbook WHERE numGb>686 AND (message LIKE '% sale %' OR message LIKE '%URL=%' OR message LIKE '%http://%' OR nickname LIKE '%cialis%' OR message LIKE '%cialis%' OR nickname LIKE '%viagra%' OR message LIKE '%viagra%' OR nickname LIKE '%casino%' OR nickname LIKE '%mortgage%');" Set rsDeleteGB = db_conn1.Execute(StrSQL) '------ end of junk filters --------- Dim ConStr, oRecordset, rsGetState, rsGetCountry,SQL ConStr = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\www\eci\cablejump.com\cablegb\cable.mdb" 'set oRecordset = Server.CreateObject("ADODB.Recordset") 'oRecordset.ActiveConnection = ConStr 'oRecordset.CursorLocation = 3 'adUseServer = 2, adUseClient = 3 'oRecordset.CursorType = 3 'SQL = "SELECT * FROM guestBook order by numGb DESC" 'oRecordset.open SQL SQL = "SELECT * FROM guestBook where numGb <= 2695 order by numGb DESC" Set oRecordset = Server.CreateObject("ADODB.Recordset") oRecordset.CursorType = 1 'adOpenKeyset oRecordset.LockType = 2 'adLockPessimistic oRecordset.ActiveConnection = db_conn1 oRecordset.open SQL oRecordset.PageSize = RecordsPageSize 'Total Number of records to show oRecordset.AbsolutePosition = 1 'To stat showing record in page size oRecordset.AbsolutePage = PageIndex 'To go on group number made by page size MaxPages = oRecordset.PageCount TotalRecords = oRecordset.RecordCount ' table display with results %> <% Dim Cpt Cpt = 1 Dim Sr 'For out puting serial number Sr = 1 do while not oRecordset.eof AND Sr <= RecordsPageSize 'do while 1=2 Set rsGetState = Server.CreateObject("ADODB.Recordset") rsGetState.CursorType = 1 'adOpenKeyset rsGetState.LockType = 2 'adLockPessimistic rsGetState.ActiveConnection = db_conn1 rsGetState.open "SELECT Name FROM States Where Code = '" & oRecordset("StateCode") & "'" '--- junk code by someone else --- ' rsGetState.ActiveConnection = Constr ' rsGetState.CursorLocation = 3 'adUseServer = 2, adUseClient = 3 ' rsGetState.CursorType = 3 ' rsGetState.Open "SELECT Name FROM States Where Code = '" & oRecordset("StateCode") & "'" Set rsGetCountry = Server.CreateObject("ADODB.Recordset") rsGetCountry.CursorType = 1 'adOpenKeyset rsGetCountry.LockType = 2 'adLockPessimistic rsGetCountry.ActiveConnection = db_conn1 rsGetCountry.open "SELECT Name FROM CountryCodes Where Code = '" & oRecordset("CountryCode") & "'" ' rsGetCountry.ActiveConnection = Constr ' rsGetCountry.CursorLocation = 3 'adUseServer = 2, adUseClient = 3 ' rsGetCountry.CursorType = 3 ' rsGetCountry.Open "SELECT Name FROM CountryCodes Where Code = '" & oRecordset("CountryCode") & "'" %>
Name: <%=Trim(oRecordset("nickname"))%>
State/Prov.: <%=Trim(rsGetState("Name"))%>
Country: <%=Trim(rsGetCountry("Name"))%>
Email: "><%=Trim(oRecordset("email"))%>
Website: "><%=trim(oRecordset("urlweb"))%>
Comments:
<%=oRecordset("NumGb")%>
<%=trim(oRecordset("message"))%>

<% Cpt = Cpt + 1 Sr = Sr + 1 oRecordset.movenext loop Dim iStart, iEnd iStart = (((PageIndex - 1 ) * RecordsPageSize ) + 1) iEnd = (PageIndex) *(RecordsPageSize) if iEnd < oRecordset.RecordCount Then iEnd = iEnd else iEnd = oRecordset.RecordCount end if Dim ref, counter %>
<% Response.Write "Page " & PageIndex & " of " & MaxPages &" "%> Go to <% If Cint(PageIndex) = Cint(MaxPages) Then Response.Write "Previous page | Next Page" Else If PageIndex = 1 Then Response.Write "Previous page | Next Page" Else Response.Write "Previous page | Next Page" End If End If%>
<% oRecordset.close set oRecordset=nothing %>