Friends I am working on Asp Paging. I want to display 5 records on first page and on otherpages I want to display 10 records. can anyone tell me how to set it? Thank you. here is my code If page = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(page) End If numPerPage = 5 Dim iPageSize 'How big our pages are Dim iPageCount 'The number of pages we get back Dim strOrderBy 'A fake parameter used to illustrate passing them Dim objPagingConn 'The ADODB connection object Dim objPagingRS 'The ADODB recordset object Dim iRecordsShown 'Loop controller for displaying just iPageSize records Dim I iPageSize = numPerPage ' You could easily allow users to change this Set objPagingRS = Server.CreateObject("ADODB.Recordset") objPagingRS.PageSize = iPageSize ' You can change other settings as with any RS 'objPagingRS.CursorLocation = adUseClient objPagingRS.CacheSize = iPageSize objPagingRS.CursorLocation = 3 objPagingRS.CursorType = 3 objPagingRS.ActiveConnection = cn ' Open RS 'response.write sql objPagingRS.Open sql ' Get the count of the pages using the given page size iPageCount = objPagingRS.PageCount ' If the request page falls outside the acceptable range, ' give them the closest match (1 or max) If iPageCurrent > iPageCount Then iPageCurrent = iPageCount If iPageCurrent < 1 Then iPageCurrent = 1 ' Check page count to prevent bombing when zero results are returned! If iPageCount = 0 Then Response.Write "No records found!" Else ' Move to the selected page objPagingRS.AbsolutePage = iPageCurrent iRecordsShown = 0
working with recordset always not a good idea, check out the url below... sure it will helps you http://www.ittreats.com/pagination-in-asp-r30.html