Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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 February 5th, 2008, 07:24 AM
Authorized User
 
Join Date: Jul 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Random record from objRS - why is EOF or BOF True?

Hi,

I'm after creating a scrolling text box (marquee) to display random quotes from our customers. I've created a db table to hold the quotes - at the moment I've just added 3 records to the table.

I'm using code to select a record at random, and display the quote along with a link to the Full Story - but intermittently I'm getting an error as follows:

ADODB.Field error '80020009'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

Here's the code I'm using...

<marquee height="100" vspace="15" scrollamount="1" direction="up" width="100%">

Set objRS = Server.CreateObject("ADODB.RecordSet")
strSQL1 = "SELECT * FROM tblQuotes"
objRS.CursorLocation = adUseClient
objRS.Open strSQL1, strConnect

While True
Randomize
intRandom = Int(objRS.RecordCount * Rnd)
objRS.Move intRandom
Response.Write(objRS.Fields("memQuote"))
Response.Write(" <br /> <a href=" & objRS.Fields("txtLink") & " class='BodyLink'>Read the Full Story...</a>")
Wend

objRS.Close
%>
</marquee>

I've put in a Response.Write line to display the intRandom figure, and it's always between 0 and 2. It'll display the info correctly for a record, then next time it tries to display that same record, it gives the error!

Please help!

J.





Similar Threads
Thread Thread Starter Forum Replies Last Post
"Either BOF or EOF is True" need help! murshed Classic ASP Databases 4 March 18th, 2008 03:43 PM
Re-try - BOF-EOF error JpaulH Access VBA 2 May 4th, 2006 02:16 PM
Access to Excel - BOF or EOF error JpaulH Access VBA 1 May 3rd, 2006 04:30 PM
Either BOF or EOF is True, or the current record h gilgalbiblewheel Classic ASP Databases 3 March 9th, 2005 07:07 PM
RecordCount Query returns EOF and BOF jigs_bhavsar Pro VB Databases 3 November 11th, 2004 09:32 AM





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