<% Recs = Request.QueryString("Recs") Set conn = Server.CreateObject("ADODB.Connection") SPath = Server.MapPath(".") If InStr(SPath,"htdocs") then SPath = Left(SPath,InStr(SPath,"htdocs")-1) SPath = SPath & "\db\art.mdb" conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SPath sql = "SELECT * FROM [Art] Order By [ImageFile]" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql, conn, 3, 3 rs.MoveLast RecsPage = 20 NumPages = rs.Recordcount Mod RecsPage If NumPages > 0 And NumPages < 6 Then NumPages = CInt(rs.Recordcount / RecsPage) + 1 Else NumPages = CInt(rs.Recordcount / RecsPage) End If rs.MoveFirst If Recs = "" Then Recs = 1 ThisPage = 1 Else If Recs <> 1 Then ThisPage = Recs Mod RecsPage If ThisPage <> 0 Then ThisPage = 1 ThisPage = ThisPage + CInt(Recs / RecsPage) + 1 End If rs.Move Recs Pos = Recs Recs = 1 End If ShowPages = "Page " For i = 1 To NumPages If i = ThisPage Then ShowPages = ShowPages & i & " " Else ShowPages = ShowPages & "" & i & " " End If Next If ThisPage <> 1 Then ShowPages = ShowPages & " <<Back " End If If ThisPage <> NumPages Then ShowPages = ShowPages & " Next>> " End If Response.Write "