[AccessD] Show only X number records at a time

Bobby Heid bheid at appdevgrp.com
Fri May 6 10:15:22 CDT 2005


I don't know exactly how they do it on EBay, but one way would be to start
off with something like:

Init lDisplayID to -1

strSQL="SELECT TOP 10 * " & _
		"FROM SomeTable " & _
		"WHERE DispID>" & displayID & " " & _
		"ORDER BY displayID ASC;"

Then, after displaying the page, you would set lDisplayID = displayID.

If the displayID was always consecutive, then to go to a given page:

'assuming that the displayID starts at 0
ldisplayID=(page-1)*ItemsPerPage

And then run the above query.

Bobby

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Joe Rojas
Sent: Friday, May 06, 2005 10:44 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Show only X number records at a time


Hi All,

How do sites like eBay show only X number of items at a time and allow users
to jump to a page number or click next?

Is there a SQL statement that allows you to select the 2nd
(3rd,4th,5th,...)set of X number of records in a database?

Thanks!
JR




This electronic transmission is strictly confidential to TNCO, Inc. and
intended solely for the addressee. It may contain information which is
covered by legal, professional, or other privileges. If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy, or take any action in reliance on this
transmission. If you have received this transmission in error, please notify
the sender as soon as possible and destroy this message. While TNCO, Inc.
uses virus protection, the recipient should check this email and any
attachments for the presence of viruses. TNCO, Inc. accepts no liability for
any damage caused by any virus transmitted by this email.
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list