|
 |
asp_web_howto thread: Recordset Page Navigation
Message #1 by info@e... on Fri, 9 Nov 2001 03:40:36
|
|
Can someone please show me how to do a recordset navigation that has page
numbers? For exmaple, a recordset returns 60 items, and I want to view 10
in each page, but then I want the option of jumping to any other group of
ten by clicking the link for the desired page number. I currently only
have "Next 10" & "Previous 10" but it is very difficult to navigate trough
when you are dealing with hundreds of records.
Tutorials would also be great!
Thanks for any help!
Regards,
Elmer M.
Message #2 by "Daniel O'Dorisio" <daniel@o...> on Thu, 8 Nov 2001 23:17:40 -0500
|
|
http://www.aspfree.com/authors/tom_smith/drp.asp kinda neat..
the basics of what you need to do is for the number of pages, you have,
write out a link that navigates to that page just like when you click
next... except have the link to the page number.
hth
daniel
--
-----------------------------
Daniel O'Dorisio
daniel@o...
www.odorisio-networks.com
-----------------------------
<info@e...> wrote in message news:118335@a..._web_howto...
>
> Can someone please show me how to do a recordset navigation that has page
> numbers? For exmaple, a recordset returns 60 items, and I want to view 10
> in each page, but then I want the option of jumping to any other group of
> ten by clicking the link for the desired page number. I currently only
> have "Next 10" & "Previous 10" but it is very difficult to navigate trough
> when you are dealing with hundreds of records.
>
> Tutorials would also be great!
>
> Thanks for any help!
>
> Regards,
> Elmer M.
>
>
Message #3 by "Ken Schaefer" <ken@a...> on Fri, 9 Nov 2001 16:07:41 +1100
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <info@e...>
Subject: [asp_web_howto] Recordset Page Navigation
: Can someone please show me how to do a recordset navigation that has page
: numbers? For exmaple, a recordset returns 60 items, and I want to view 10
: in each page, but then I want the option of jumping to any other group of
: ten by clicking the link for the desired page number. I currently only
: have "Next 10" & "Previous 10" but it is very difficult to navigate trough
: when you are dealing with hundreds of records.
:
: Tutorials would also be great!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I think I've written about the need to *write* your logic out before you
start coding. Once you do that, it's quite easy.
Let's think about what you need. To display links to each "page" of records,
you need to know:
a) how many records you have in total
b) how many records you have per page
c) the number of pages is thus a/b rounded up...
eg 125 records, at 10 records per page = 12.5 pages = 13 links (pages
1...13)
13 can be obtained by doing <% Fix(125/10) + 1 %>
So, we write out links inside a loop, starting at Page 1, and then looping
until we get to 13.
So you could do it like this:
<%
intCounter = intRecsPerPage
Do While intCounter < intTotalRecords
Response.Write( _
"<a href=""results.asp" & _
"?intPage=" & intCounter/intRecsPerPage " & _
"&intPageSize=" & intRecsPerPage & """>" & _
"Page " & intCounter/intRecsPerPage & "</a>")
Loop
%>
no?
Cheers
Ken
Message #4 by "phil griffiths" <pgtips@m...> on Fri, 9 Nov 2001 10:10:47
|
|
I had to do this recently - here's 3 urls I found helpful:
1. www.4guysfromrolla.com/webtech/050901-1.shtml
2. www.4guysfromrolla.com/webtech/062899-1.shtml
3. microsoft knowledge base article Q202125
quick summary:
1 shows example of paging on the client-side using javascript (this is the
one I used with a few mods coz it didn't quite fit what I wanted)
2. example paging on db server using stored procedure
3. example ADO recordset paging using PageSize and PageCount properties.
I'm sure there are other ways too.
HTH
Phil
> Can someone please show me how to do a recordset navigation that has
page
> numbers? For exmaple, a recordset returns 60 items, and I want to view
10
> in each page, but then I want the option of jumping to any other group
of
> ten by clicking the link for the desired page number. I currently only
> have "Next 10" & "Previous 10" but it is very difficult to navigate
trough
> when you are dealing with hundreds of records.
>
> Tutorials would also be great!
>
> Thanks for any help!
>
> Regards,
> Elmer M.
Message #5 by Jay Franklin <jayrfranklin@y...> on Fri, 9 Nov 2001 04:08:19 -0800 (PST)
|
|
To All,
Speaking of recordsets. I am using SQLServer 7.0 and
have a substantial amount of data in our database. 1.
Table 1 has 1.2 million records
1. Table 2 700,000 records, which is joined to table
1.
Can someone give me some ideas as to displaying the
data in a browser without timing out.
Thanks
Jay
--- phil griffiths <pgtips@m...> wrote:
> I had to do this recently - here's 3 urls I found
> helpful:
> 1. www.4guysfromrolla.com/webtech/050901-1.shtml
> 2. www.4guysfromrolla.com/webtech/062899-1.shtml
> 3. microsoft knowledge base article Q202125
>
> quick summary:
> 1 shows example of paging on the client-side using
> javascript (this is the
> one I used with a few mods coz it didn't quite fit
> what I wanted)
> 2. example paging on db server using stored
> procedure
> 3. example ADO recordset paging using PageSize and
> PageCount properties.
>
> I'm sure there are other ways too.
> HTH
> Phil
>
> > Can someone please show me how to do a recordset
> navigation that has
> page
> > numbers? For exmaple, a recordset returns 60
> items, and I want to view
> 10
> > in each page, but then I want the option of
> jumping to any other group
> of
> > ten by clicking the link for the desired page
> number. I currently only
> > have "Next 10" & "Previous 10" but it is very
> difficult to navigate
> trough
> > when you are dealing with hundreds of records.
> >
> > Tutorials would also be great!
> >
> > Thanks for any help!
> >
> > Regards,
> > Elmer M.
> jayrfranklin@y...
> $subst('Email.Unsub')
>
__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com
Message #6 by "Ken Schaefer" <ken@a...> on Sat, 10 Nov 2001 00:44:41 +1100
|
|
You want to display 2,700,000 records in the browser?!? at once?!? What
practicaly application does that have?
Or are you looking for a paging system?
www.adopenstatic.com/experiments/recordsetpaging.asp
has code for three different methods (brute force, #temp table, and ADO
paging)
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Jay Franklin" <jayrfranklin@y...>
Subject: [asp_web_howto] Re: Recordset Page Navigation
: Speaking of recordsets. I am using SQLServer 7.0 and
: have a substantial amount of data in our database. 1.
: Table 1 has 1.2 million records
: 1. Table 2 700,000 records, which is joined to table
: 1.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #7 by "Ken Schaefer" <ken@a...> on Sat, 10 Nov 2001 00:46:42 +1100
|
|
There's one additional example here:
www.adopenstatic.com/experiments/recordsetpaging.asp
If you have your own DB and web servers connected via fast links (eg
switched 100 or 1000 MB/sec switches) then brute force paging with SQL
Server 2000 (just .move + getRows(numRecs) beats everything else...
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "phil griffiths" <pgtips@m...>
Subject: [asp_web_howto] Re: Recordset Page Navigation
: I had to do this recently - here's 3 urls I found helpful:
: 1. www.4guysfromrolla.com/webtech/050901-1.shtml
: 2. www.4guysfromrolla.com/webtech/062899-1.shtml
: 3. microsoft knowledge base article Q202125
:
: quick summary:
: 1 shows example of paging on the client-side using javascript (this is the
: one I used with a few mods coz it didn't quite fit what I wanted)
: 2. example paging on db server using stored procedure
: 3. example ADO recordset paging using PageSize and PageCount properties.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #8 by Jay Franklin <jayrfranklin@y...> on Fri, 9 Nov 2001 06:07:51 -0800 (PST)
|
|
Thanks for the info. I have already found it very
useful.
Jay
--- phil griffiths <pgtips@m...> wrote:
> I had to do this recently - here's 3 urls I found
> helpful:
> 1. www.4guysfromrolla.com/webtech/050901-1.shtml
> 2. www.4guysfromrolla.com/webtech/062899-1.shtml
> 3. microsoft knowledge base article Q202125
>
> quick summary:
> 1 shows example of paging on the client-side using
> javascript (this is the
> one I used with a few mods coz it didn't quite fit
> what I wanted)
> 2. example paging on db server using stored
> procedure
> 3. example ADO recordset paging using PageSize and
> PageCount properties.
>
> I'm sure there are other ways too.
> HTH
> Phil
>
> > Can someone please show me how to do a recordset
> navigation that has
> page
> > numbers? For exmaple, a recordset returns 60
> items, and I want to view
> 10
> > in each page, but then I want the option of
> jumping to any other group
> of
> > ten by clicking the link for the desired page
> number. I currently only
> > have "Next 10" & "Previous 10" but it is very
> difficult to navigate
> trough
> > when you are dealing with hundreds of records.
> >
> > Tutorials would also be great!
> >
> > Thanks for any help!
> >
> > Regards,
> > Elmer M.
> jayrfranklin@y...
> $subst('Email.Unsub')
>
__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com
|
|
 |