<% 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                   Photo Gallery                   Testimonials
Photo Gallery
<% if isEmpty(galArr)=False Then %> <% for i = 0 To toctr %> <% next %> <% if rs.pagecount > 1 then %> <% end if %> <% else %> <% end if %>
<%if Trim(galArr(2,i)) <> "" then response.write "" else response.write " " end if%> <%=Trim(galArr(1,i))%>
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 %>
<%=EMsg%>