asafaq article id=2120 - paging

Discussion in 'ASP General' started by Girish, Feb 10, 2004.

  1. Girish

    Girish Guest

    I am trying to use GetRowsMove method since we are not using stored
    procedures, I got until 77 rows found. Showing page 1 of 2. - nothing shows
    up in the list box and GetRowsMove.asp I couldn't get that up and running
    instead of your recordset I am pulling from my own database that is the only
    difference...

    Thanks
    Girish, Feb 10, 2004
    #1
    1. Advertising

  2. You're going to need to show your code. We can't fix what we can't see.

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "Girish" <> wrote in message
    news:#lVVS2$...
    > I am trying to use GetRowsMove method since we are not using stored
    > procedures, I got until 77 rows found. Showing page 1 of 2. - nothing

    shows
    > up in the list box and GetRowsMove.asp I couldn't get that up and running
    > instead of your recordset I am pulling from my own database that is the

    only
    > difference...
    >
    > Thanks
    >
    >
    Aaron Bertrand - MVP, Feb 10, 2004
    #2
    1. Advertising

  3. Girish

    Girish Guest

    here is the include page <!-- #include
    virtual="/carmartnew/include/topRS.asp.asp" -->code:
    <% 'Option Explicit
    'response.buffer = true%>
    <%
    Dim strQrySelect3, RowCnt, RecSet3, PerPage, PageNum, PageCnt, rsOutput3
    RowCnt = 0

    RowCnt = rscount ' rscount is my recordset from DB

    if RowCnt = 0 then
    Response.Write "No rows found."
    Response.End
    end if

    PerPage = Trim(Request.QueryString("PerPage"))
    PageNum = Trim(Request.QueryString("PageNum"))

    If PerPage = "" or (len(PerPage)>0 and not isnumeric(PerPage)) Then _
    PerPage = 50

    If PageNum = "" or (len(PageNum)>0 and not isnumeric(PageNum)) Then _
    PageNum = 1

    PerPage = PerPage
    PageNum = PageNum

    'response.write "RowCnt :" &RowCnt&"<br>"
    'response.write "PerPage :" &PerPage&"<br>"
    PageCnt = RowCnt \ PerPage

    if RowCnt mod PerPage <> 0 then PageCnt = PageCnt + 1
    if PageNum < 1 Then PageNum = 1
    if PageNum > PageCnt Then PageNum = PageCnt

    Dim url, urlParts, pageName

    url = Request.ServerVariables("SCRIPT_NAME")
    urlParts = split(url, "/")
    pageName = urlParts(ubound(urlParts))
    %>
    <script language="JavaScript" type="text/javascript">
    function go(p)
    {
    if (p!='current')
    window.location.href = "<%=pageName%>?"
    +"PerPage=<%=PerPage%>&"
    +"PageNum="+p;
    }
    </script>
    <%
    response.write RowCnt & " rows found. Showing " & _
    " page " & PageNum & " of " & PageCnt & "."

    response.write " <select onchange='go(this.value);'>"

    for i = 1 to PageCnt
    link = i: s = ""
    if i = PageNum then link = "current": s=" SELECTED"
    response.write "<option value=" & link & s & ">" **
    I don't get any value here in select list.
    response.write "Page " & i
    next
    Response.Write "</select><p>"

    %>

    Here is the code of CODE page as per your article where I am including above
    page

    ** This code suppose to do what??? need more explanation...
    Dim gr, rstop
    rstop = PerPage * PageNum
    rstart = rstop - (PerPage - 1)
    rs.move(rstart-1)** main change
    rsOutput2.move(rstart-1)

    if rstop > RowCnt - 1 then PerPage = (RowCnt - 1) - rstart
    gr = rs.GetRows(PerPage)
    gr = rsOutput2.GetRows(PerPage)

    response.write "gr" & gr

    for i = 0 to perpage-1

    artist = gr(0, i)
    title = gr(1, i)

    response.write "artist" & artist
    next

    Thanks much! Would you also do consulting?
    "Aaron Bertrand - MVP" <> wrote in message
    news:%...
    > You're going to need to show your code. We can't fix what we can't see.
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
    >
    >
    > "Girish" <> wrote in message
    > news:#lVVS2$...
    > > I am trying to use GetRowsMove method since we are not using stored
    > > procedures, I got until 77 rows found. Showing page 1 of 2. - nothing

    > shows
    > > up in the list box and GetRowsMove.asp I couldn't get that up and

    running
    > > instead of your recordset I am pulling from my own database that is the

    > only
    > > difference...
    > >
    > > Thanks
    > >
    > >

    >
    >
    Girish, Feb 12, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. [AF] Abdulhafid

    Current Issues Article Archive

    [AF] Abdulhafid, Oct 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    439
    [AF] Abdulhafid
    Oct 12, 2003
  2. admin

    Test news article with format

    admin, Oct 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    414
    tamttt
    Oct 2, 2004
  3. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    DataSet paging vs Datareader paging

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    10,654
    Scott Allen
    Oct 8, 2004
  4. wh1974
    Replies:
    0
    Views:
    2,416
    wh1974
    Jan 12, 2005
  5. Red
    Replies:
    1
    Views:
    702
Loading...

Share This Page