% dim rst, strSQL, Txt, cnt, Colour, noOfRecords, noOfPages, cntPageCount, startPage, endPage, imgHeight, imgWidth 'Create the Recordset object set Rst = server.CreateObject("ADOR.Recordset") set RstCount = server.CreateObject("ADOR.Recordset") 'Open the connection to the database 'Conn.Open strCon if Request.QueryString ("startPage") = "" then startPage = 0 else startPage = Request.QueryString ("startPage") end if if Request.QueryString ("startPage") = "" then endPage = 5 else endPage = Request.QueryString ("endPage") end if strSQL = "SELECT COUNT(*) FROM NEWS" rst.CursorLocation = aduseserver rst.open strsql,conn noOfRecords = rst.Fields (0) rst.Close strSQL = "SELECT News.* FROM News WHERE (((News.NEWSID) > " & startPage & " and (News.NEWSID)<= " & endPage & "))" rst.open strsql,conn imgHeight=120 imgWidth=150 If rst.EOF = false then 'noOfRecords = rst.RecordCount rst.MoveFirst if noOfRecords > 5 then noOfPages = noOfRecords / 5 else noOfPages = 1 end if End if %>
|
|
<% dim i j = 1 for i = 0 to noOfRecords step 5 %> <% =Response.Write (j) %> <% j = j +1 next %> |