Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2004, 03:30 AM
Authorized User
 
Join Date: Jan 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Previous/Next records in asp

Please tell me how do do this, assuming the following
<%Option Explicit
dim objconn, objRS,strSQL

set objconn=server.createobject("adodb.connection")
objconn.open "DSN=PMS"

set objRS=server.createobject("adodb.recordset")

strSQL="SELECT * FROM Projects"
objRS.open, strSQL,3,3
%>

<html>
<head>
<title>Projects</title>
</head>
<body>
<table align="center" width="100%" height="100%">
<tr>
<td>Project Title</td>
</tr>
<tr>
<td>Project Status</td>
</tr>
<%while not objRS.recordcount%>
<tr>
<td><%=objRS("project_title")%></td>
</tr>
<tr>
<td><%=objRS("project_status")%></td>
</tr>
<%objRS.MoveNext
wend%>
</table>
</body>
</html>

Thanks.

Nicky.
 
Old January 24th, 2004, 04:57 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

What you are looking for is call "paging" where the contents of a Recordset are split over multiple pages.
If you're using a tool like Dreamweaver MX, this is really easy. Just add a Server Behavior, set a few properties and off you go.

If you're hand coding, you may be interested in this article: http://www.asp101.com/samples/db_paging.asp

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 24th, 2004, 05:39 AM
Authorized User
 
Join Date: Jan 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks. This is ecaxtlu what I was looking for.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional select previous records' value sjanderson XSLT 5 May 4th, 2007 03:28 AM
Get values of asp controls on previous page GraceOriole ASP.NET 2.0 Professional 0 December 20th, 2006 11:35 PM
Need Expert Advice - Checking Previous Records Zippyfrog Access VBA 4 July 15th, 2006 09:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.