Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Recordset Paging


Message #1 by 012984479@m... on Mon, 23 Jul 2001 12:35:25
Dear All,



I want to do the following:



There are one field in my table including 18 records. I want them display 

in 3 rows and 3 columns. In one row there are 3 records. Additionally, I 

want to have an Next, Previous, First, Last button to naviate my records. 

So, in my example, I must click Next to see my last 9 records.



Thanks

Phannarith
Message #2 by "raghu bejgum" <raghu_hale@h...> on Mon, 23 Jul 2001 18:11:08 +0530
<%	Dim currentpage, rowcount, i

        currentpage = TRIM(Request("CurrentPage"))				if currentpage="" then 

currentpage=1				set rs = 

server.CreateObject("ADODB.RecordSet")			rs.CursorLocation = 

3						rs.CursorType = adOpenStatic					rs.pageSize=9 'This number indicates 

the number of records to be displayed in the page.

%>

<%

sql1 = "SELECT jokestbl.serialno, jokestbl.username, jokestbl.title, 

jokestbl.joke, jokestbl.subdate FROM jokestbl where (archive = 0) ORDER BY 

jokestbl.subdate DESC "

	RS.open sql1,conn

        If Not RS.EOF Then							rs.AbsolutePage = 

cINT(currentpage)					rowcount = 0%>

<%for i=1 to rs.pageCount

	if cint(currentpage)=cint(i) then

		response.write(i)

	else%>

	<a href="viewjoke.asp?currentpage=<%=i%>"><%=i%></a>

	<%end if%>

	<%next%>



Raghavendra.B

S/w Engg,

Globarena Group







>From: 012984479@m...

>Reply-To: "ASP Databases" <asp_databases@p...>

>To: "ASP Databases" <asp_databases@p...>

>Subject: [asp_databases] Recordset Paging

>Date: Mon, 23 Jul 2001 12:35:25

>

>Dear All,

>

>I want to do the following:

>

>There are one field in my table including 18 records. I want them display

>in 3 rows and 3 columns. In one row there are 3 records. Additionally, I

>want to have an Next, Previous, First, Last button to naviate my records.

>So, in my example, I must click Next to see my last 9 records.

>

>Thanks

>Phannarith

>---

Message #3 by "Grant I" <giswim1@a...> on Mon, 23 Jul 2001 14:22:29
Hey I found this article on 4guysfromrolla.com EXTREMELY useful when I was 

designing my pages.  You should check it out.  Adding the first and last 

buttons should be fairly intuitive.



http://www.4guysfromrolla.com/webtech/121298-1.shtml
Message #4 by "Ken Schaefer" <ken@a...> on Tue, 24 Jul 2001 14:16:32 +1000
Might want to also look at:

http://www.adopenstatic.com/experiments/recordsetpaging.asp

for faster ways to do this.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----- Original Message -----

From: "Grant I" <giswim1@a...>

To: "ASP Databases" <asp_databases@p...>

Sent: Monday, July 23, 2001 2:22 PM

Subject: [asp_databases] Re: Recordset Paging





: Hey I found this article on 4guysfromrolla.com EXTREMELY useful when I was

: designing my pages.  You should check it out.  Adding the first and last

: buttons should be fairly intuitive.

:

: http://www.4guysfromrolla.com/webtech/121298-1.shtml



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




  Return to Index