<%@Language=VBScript%> <%Option Explicit%> <%Response.Buffer = True%> <% 'Navigation System sub PageNavigation () Response.Write "" 'below is the page navigation using links. Response.Write "" Response.Write "
" If Current_Page = 1 Then Response.Write "primera" End If If Current_Page >= 2 Then Response.Write "primera" End If Response.Write "" If Current_Page <> 1 Then Response.Write "previa" End If If Current_Page = 1 Then Response.Write "previa" End If Response.Write "" If Current_Page >= Page_Count Then Response.Write "próxima" End If If Current_Page < Page_Count Then Response.Write "próxima" End IF Response.Write "" If Current_Page <> Page_Count Then Response.Write "última" End If If Current_Page >= Page_Count Then Response.Write "última" End If Response.Write "
Página " & Current_Page & " de " & Page_Count & "
" end sub 'End Navigation System %> Carlos Eduardo Granier - Fotografías
c a r l a n g a . c o m 
 f o t o s 
<% Dim Connect_String Dim Page_Size Dim Current_Page Dim Page_Count Dim MyConn, RS, SQL Dim intIndexImage 'Connect_String="Provider={Microsoft Access Driver (*.mdb)}; DBQ=C:\Databases\paging.mdb" Connect_String="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\\premfs2\sites\premium7\catdog\database\fotos.mdb" & ";PWD=astro99bk" Page_Size = 1 'this is where you set the # of records displayed per page If Request("Page") = "" Then Current_Page = 1 Else Current_Page = CInt(Request("Page")) End If IF (Current_Page / 10) > (CInt(Current_Page / 10)) THEN intIndexImage = (CInt(Current_Page / 10) + 1) ELSE intIndexImage = (CInt(Current_Page / 10)) END IF Set MyConn=Server.CreateObject("ADODB.Connection") Set RS=Server.CreateObject("ADODB.RecordSet") MyConn.Open Connect_String RS.CursorLocation = adUseClient RS.PageSize = Page_Size IF Request("id") = "" THEN SQL = "SELECT * FROM fotos INNER JOIN location ON fotos.locID = location.ID" ELSE SQL = "SELECT * FROM fotos INNER JOIN location ON fotos.locID = location.ID WHERE fotos.locID = " & CInt(Request("id")) END IF RS.Open SQL, MyConn, adOpenStatic, adLockReadOnly, adCmdText Page_Count = RS.PageCount If 1 > Current_Page Then Current_Page = 1 If Current_Page > Page_Count Then Current_Page = Page_Count RS.AbsolutePage = Current_Page Call PageNavigation %>
<% Do While RS.AbsolutePage = Current_Page And Not RS.EOF %> <% RS.MoveNext Loop RS.Close Set RS = Nothing MyConn.Close Set MyConn = Nothing %>
"><% Response.Write("")%>
<% Call PageNavigation %>