SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 18th, 2002, 03:30 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
showing 25 rows of a table in each page

<i><b>Originally posted by : yaron (yaron_kh@yahoo.com)</b></i><br />hello<br /><br />i'm trying to show 25 rows of a table in a one page and with the NEXT button show the next 25 rows and so on.<br /><br /><br />what is a good way (minimal use of resources)<br />to do that?<br /><br />i don't want to leave an open connection to the database.<br /><br />thanks<br />yaron

Reply With Quote
  #2  
Old February 19th, 2002, 11:56 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<i><b>Originally posted by : Greg (gregdirst@yahooNOSPAM.com)</b></i><br /><br />Hi,<br /><br />You can do it in many ways, but this is one I recommend.<br /><br /><br />Loop through the recordset from the beginning point through the next 25 records or EOF. Before you end the form add a hidden input field (or you can use a query string) and save the absolute position of where you left off. When the user clicks next then post the page (or let the query string pass the absolute position you left off) and the next time the page draws you simple do a move first then loop through the next 25 or EOF.<br /><br />Hope this helps. Code sample below.<br /><br />Greg<br /><br /><%<br /> Dim lStartPosition, _<br /> bDone<br /><br /> '--determine where to start<br /> if not isempty(request("startat")) then<br /> lStartPosition = request("startat")<br /> rs.move lStartPosition<br /> else<br /> lStartPosition = 0<br /> end if<br /><br /> '--do loop<br /> do while not rs.eof And Not bDone<br /> bDone = cbool(rs.absoluteposition = (lStartPosition + 25))<br /> rs.move next<br /> loop<br />%><br /><br />------------<br />yaron at 2/18/2002 12:30:10 PM<br /><br />hello<br /><br />i'm trying to show 25 rows of a table in a one page and with the NEXT button show the next 25 rows and so on.<br /><br /><br />what is a good way (minimal use of resources)<br />to do that?<br /><br />i don't want to leave an open connection to the database.<br /><br />thanks<br />yaron

Reply With Quote
  #3  
Old February 19th, 2002, 12:01 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<i><b>Originally posted by : Greg</b></i><br /><br />BTW, you will connect from the data before the code and disconnect after it on each page refresh.<br /><br />------------<br />Greg at 2/19/2002 8:56:10 AM<br /><br /><br />Hi,<br /><br />You can do it in many ways, but this is one I recommend.<br /><br /><br />Loop through the recordset from the beginning point through the next 25 records or EOF. Before you end the form add a hidden input field (or you can use a query string) and save the absolute position of where you left off. When the user clicks next then post the page (or let the query string pass the absolute position you left off) and the next time the page draws you simple do a move first then loop through the next 25 or EOF.<br /><br />Hope this helps. Code sample below.<br /><br />Greg<br /><br /><%<br /> Dim lStartPosition, _<br /> bDone<br /><br /> '--determine where to start<br /> if not isempty(request("startat")) then<br /> lStartPosition = request("startat")<br /> rs.move lStartPosition<br /> else<br /> lStartPosition = 0<br /> end if<br /><br /> '--do loop<br /> do while not rs.eof And Not bDone<br /> bDone = cbool(rs.absoluteposition = (lStartPosition + 25))<br /> rs.move next<br /> loop<br />%><br /><br />------------<br />yaron at 2/18/2002 12:30:10 PM<br /><br />hello<br /><br />i'm trying to show 25 rows of a table in a one page and with the NEXT button show the next 25 rows and so on.<br /><br /><br />what is a good way (minimal use of resources)<br />to do that?<br /><br />i don't want to leave an open connection to the database.<br /><br />thanks<br />yaron

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > showing 25 rows of a table in each page


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT