473,394 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Paging Recordset - Almost There

Hi All,

As you may have seen from my earlier post, I am trying to setup paging on an
ASP application, I *think* this is 99% there.

The only problem I have left, is when I get to the last page, I get the
following error:
ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested
operation requires a current record.
/myscript.asp, line 119 (See below for marker as to
where 119 is)
Now, I know the problem lies with my loop - Its looping from 1 to 20
(rs.PageSize) even though the last page will have less records on it (Unless
we are very lucky and the total number of records is always divisable by
20!) I am just not sure what the Loop needs to be!

Below is my code (Snipped to the relevent bits for ease of reading!)

Any help will of course be appreciated!

Cheers!
Simon.
// What page are we on?
if (parseInt(Request.QueryString("Page")) 0) {
nPage = parseInt(Request.QueryString("Page"));
} else {
nPage = 1;
}

// Get data
var rs= Server.CreateObject("ADODB.Recordset");
rs.ActiveConnection = "dsn=TheData;";
rs.Source = "SELECT * FROM customers;";
rs.CursorLocation = 3;// adUseClient (Default locktype and cursortype)
rs.PageSize = 20;
rs.CacheSize = rsCartsCompleted.PageSize // Cache data - Not sure if this
helps yet! Need to test!
rs.Open();
var rs_numRows = 0;
nPageCount = rs.PageCount;
rs.AbsolutePage = nPage;

// Do the loop
for (i=1;i<=rs.PageSize;i++) {
// Display records...Line 119 is here, the first time I try to write out
some data.
rs.MoveNext();
}

--
--
* Please reply to group for the benefit of all
* Found the answer to your own question? Post it!
* Get a useful reply to one of your posts?...post an answer to another one
* Search first, post later : http://www.google.co.uk/groups
* Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
May 30 '07 #1
2 1918
Simon wrote on Wed, 30 May 2007 23:33:38 +0100:
Hi All,

As you may have seen from my earlier post, I am trying to setup paging on
an ASP application, I *think* this is 99% there.

The only problem I have left, is when I get to the last page, I get the
following error:
ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
/myscript.asp, line 119 (See below for marker as to
where 119 is)

// Do the loop
for (i=1;i<=rs.PageSize;i++) {
// Display records...Line 119 is here, the first time I try to write
out some data.
rs.MoveNext();
}
Check for EOF on the recordset after each MoveNext(), if it's true then
break out of the loop.

Dan
May 31 '07 #2
Check for EOF on the recordset after each MoveNext(), if it's true then
break out of the loop.
Dan - Great, working AOK now - Thank you!
May 31 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dima | last post by:
Does anybody know where can i get a sample on how to do recordset paging between two frames or between page an iframe that is within. ----------------------------- This message is posted by...
2
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned...
4
by: david | last post by:
Hi I have written code in ASP for paging records from the database (SQL Server 2000). The real problem I have around 10,000 records and it tries to fetch all the records everytime (I'm saying...
1
by: Li | last post by:
Hi, guys, I got a problem when trying to paging the recordset. the problem is even I set the pagesize but the first page will always show all the records and the number of records that shown on...
3
by: sara | last post by:
Hi all, I have a strange problem. I have a page where I am creating a recordset that can handle paging and the query for it was originally selecting from only one table. This was all working...
1
by: Kevin | last post by:
Can anyone point me to a code example where a recordset.absolutepage is sorted independantly of the original recordset. That is; if I populate an ADO recordset with an ORDER BY ListingDate clause,...
3
by: Eugene Anthony | last post by:
The code bellow does paging of recordset. How do I create the next and previous button for this code? Also is there a way of implementing paging without including adovbs.inc? <!-- #INCLUDE...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
6
by: Yosi | last post by:
Hi all, I have access database file with 2 tables, the tables have the same columns but with different data, and I have 2 asp files that show the content of each table with paging recordset,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.