USMRA Message Log
[ View by Date | 2012 | 2013 | 2014 | 2015 | 2016 | Add Message ]
Search by Word or Phrase
<% Dim objConn Set objConn = Server.CreateObject("ADODB.Connection") 'objConn.Open "Data Source=//nawinfs04/home/users/web/b2825/rh.bwilliam/database/guestbook.mdb;Provider=Microsoft.Ace.OLEDB.12.0;" objConn.Open = "Provider=Microsoft.Ace.OLEDB.12.0;Data Source=" & Server.MapPath("\database/guestbook.mdb") & ";" Dim TotalPages, NumPerPage, CurrentPage, Number Dim strQuery, ObjRs, Count 'Defines the inicial Value as "5" If request("NumPerPage") <> 0 then NumPerPage = Int(request("NumPerPage")) else NumPerPage = 5 strQuery = "SELECT * FROM guestbook ORDER BY ID DESC" Set ObjRs = Server.CreateObject("ADODB.Recordset") If Request.QueryString("page") = "" then CurrentPage = 1 'We're on the first page Else CurrentPage = CInt(Request.QueryString("page")) End If objRS.Open strQuery, objConn, 3, 3 'Opened as Read-Only Number = objRS.RecordCount If Not objRS.EOF Then objRS.MoveFirst objRS.PageSize = NumPerPage TotalPages = objRS.PageCount objRS.AbsolutePage = CurrentPage End If Dim ScriptName ScriptName = request.servervariables("ScriptName") %>
<% 'Print the recent Data response.write "Page " & CurrentPage & " of " & TotalPages & ": Total of " & Number & " messages " %>
<% 'Creating the paging numbers Dim ini, fim, a 'Display PREV page link, if appropriate If Not CurrentPage = 1 Then Response.Write "prev  " if CurrentPage > 5 and TotalPages > 10 then Response.write("1" & " ...  " ) end if if TotalPages > 10 then if CurrentPage > 5 then if TotalPages > (CurrentPage + 5) then ini = (CurrentPage - 4) fim = (CurrentPage + 5) else ini = (TotalPages - 9) fim = TotalPages end if else ini = 1 fim = 10 end if else ini=1 fim = TotalPages end if For a = ini to fim If a = Cint(request("page")) then Response.write( "" & a & "  ") Else Response.write("" & a & "" & "  " ) End if Next Else if TotalPages = 1 then Response.write "" Else Response.Write "1  " End if if TotalPages > 10 then fim = 10 else fim = TotalPages end if For a = 2 to fim If a = Cint(request("page")) then Response.write( "" & a & "  ") Else Response.write("" & a & "" & "  " ) End if Next End If if CurrentPage < TotalPages - 5 and TotalPages > 10 then Response.write("... " & TotalPages & "" & "  " ) end if 'Display NEXT page link, if appropriate If Not CurrentPage = TotalPages Then Response.Write "next" Else Response.Write "" End If %>

<% While Not objRS.EOF and Count < objRS.PageSize count = count + 1 %>
Posted: <% =objRS("Posted_Month") %>/<% =objRS("Posted_Day") %>/<% =objRS("posted_Year") %>
Name: <% If objRS("email") = "" Then %> <% =objRS("name") %> <% else %> ><% =objRS("name") %> <% end If %>
Message: <% =objRS("comment") %>

<% objRS.MoveNext Wend objRs.close Set objRs = Nothing %>
<% 'Print the recent Data response.write "Page " & CurrentPage & " of " & TotalPages & ": Total of " & Number & " messages " %>
<% 'Creating the paging numbers 'Display PREV page link, if appropriate If Not CurrentPage = 1 Then Response.Write "prev  " if CurrentPage > 5 and TotalPages > 10 then Response.write("1" & " ...  " ) end if if TotalPages > 10 then if CurrentPage > 5 then if TotalPages > (CurrentPage + 5) then ini = (CurrentPage - 4) fim = (CurrentPage + 5) else ini = (TotalPages - 9) fim = TotalPages end if else ini = 1 fim = 10 end if else ini=1 fim = TotalPages end if For a = ini to fim If a = Cint(request("page")) then Response.write( "" & a & "  ") Else Response.write("" & a & "" & "  " ) End if Next Else if TotalPages = 1 then Response.write "" Else Response.Write "1  " End if if TotalPages > 10 then fim = 10 else fim = TotalPages end if For a = 2 to fim If a = Cint(request("page")) then Response.write( "" & a & "  ") Else Response.write("" & a & "" & "  " ) End if Next End If if CurrentPage < TotalPages - 5 and TotalPages > 10 then Response.write("... " & TotalPages & "" & "  " ) end if 'Display NEXT page link, if appropriate If Not CurrentPage = TotalPages Then Response.Write "next" Else Response.Write "" End If %>
 
 
 

Send Questions & Comments
© US Mountain Ranger Association 2008
46 Jones Road, Blairsville, GA 30512

U.S. Mountain Ranger Association, Inc. is an equal opportunity source of assistance.
USMRA does not discriminate based on race, color, nationality, religion, gender or sexual orientation.