%
EMsg = "No Photo Gallery found"
set rs = Server.CreateObject("ADODB.Recordset")
''''' Code for paging
rs.CursorLocation = adUseClient
rs.PageSize = 10
currentPage=trim(Request("currentPage"))
if currentPage = "" or isNumeric(currentPage) = False then currentPage = 1
''''' End Code for paging
strSQL = "select a.galid, a.heading, a.imgname from photo_gallary a where a.display = 'Y' order by a.logdate desc"
'response.write strSQL
'response.end
rs.Open strSQL, con, 3, 3
if not rs.EOF Then
''' Paging
if Cint(currentPage)=0 or Cint(currentPage) > rs.PageCount then
rs.AbsolutePage = rs.PageCount
currentPage = rs.PageCount
else
rs.AbsolutePage = Cint(currentPage)
end if
galArr = rs.GetRows()
if isEmpty(galArr) = False Then
if UBound(galArr,2) >= (rs.PageSize-1) then
toctr = (rs.PageSize-1)
else
toctr = UBound(galArr,2)
end if
end if
'' End Paging
end if
%>
Art of Good Drivers - Ontario Driving License, Driving School, Driver Training, Mississauga
Page <%=currentPage & " of " & rs.PageCount&" -"%>
<%
for p = 1 to rs.PageCount
if cint(currentpage) <> cint(p) then
%>
<%=p%>
<%
else
Response.Write "[" & p & "] "
end if
next
%>