472,345 Members | 1,594 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,345 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 1882
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. ...
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...
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...
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...
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...
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...
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...
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...
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...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

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.