asafaq article id=2120 - paging

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Girish

    asafaq article id=2120 - paging

    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

    #2
    Re: asafaq article id=2120 - paging

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

    --
    Aaron Bertrand
    SQL Server MVP
    Please contact this domain's administrator as their DNS Made Easy services have expired.





    "Girish" <girishkiss@yah oo.com> wrote in message
    news:#lVVS2$7DH A.452@TK2MSFTNG P11.phx.gbl...[color=blue]
    > 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[/color]
    shows[color=blue]
    > 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[/color]
    only[color=blue]
    > difference...
    >
    > Thanks
    >
    >[/color]


    Comment

    • Girish

      #3
      Re: asafaq article id=2120 - paging

      here is the include page <!-- #include
      virtual="/carmartnew/include/topRS.asp.asp" -->code:
      <% 'Option Explicit
      'response.buffe r = 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.Qu eryString("PerP age"))
      PageNum = Trim(Request.Qu eryString("Page Num"))

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

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

      PerPage = PerPage
      PageNum = PageNum

      'response.write "RowCnt :" &RowCnt&"<br >"
      'response.write "PerPage :" &PerPage&"<b r>"
      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.ServerV ariables("SCRIP T_NAME")
      urlParts = split(url, "/")
      pageName = urlParts(ubound (urlParts))
      %>
      <script language="JavaS cript" type="text/javascript">
      function go(p)
      {
      if (p!='current')
      window.location .href = "<%=pageName%>? "
      +"PerPage=<%=Pe rPage%>&"
      +"PageNum="+ p;
      }
      </script>
      <%
      response.write RowCnt & " rows found. Showing " & _
      " page " & PageNum & " of " & PageCnt & "."

      response.write " <select onchange='go(th is.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(PerP age)
      gr = rsOutput2.GetRo ws(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" <aaron@TRASHasp faq.com> wrote in message
      news:%23k4A60A8 DHA.632@TK2MSFT NGP12.phx.gbl.. .[color=blue]
      > 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" <girishkiss@yah oo.com> wrote in message
      > news:#lVVS2$7DH A.452@TK2MSFTNG P11.phx.gbl...[color=green]
      > > 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[/color]
      > shows[color=green]
      > > up in the list box and GetRowsMove.asp I couldn't get that up and[/color][/color]
      running[color=blue][color=green]
      > > instead of your recordset I am pulling from my own database that is the[/color]
      > only[color=green]
      > > difference...
      > >
      > > Thanks
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...