Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old April 12th, 2004, 07:34 AM
Registered User
Join Date: Apr 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default RecordCount Query returns EOF and BOF


I am firing query "SELECT COUNT(*) FROM EMPLOYEE" from Visual basic and populating recordset

rs.open "SELECT COUNT(*) FROM EMPLOYEE" , ConnectionObject

MSGBOX RS.FIELDS(0).VALUE --Here is gives me error

Error Code: 3021
Error Description: Either BOF or EOF is True or the current record has been deleted. Requested operation requires a current record

If I try to move the recordset to the first record, before fetching it, even it is giving me an error.

What could be the reason behind this? The same query runs on other PCs, but it throws an error on specific machine.

Please help me out

Reply With Quote
  #2 (permalink)  
Old April 12th, 2004, 03:53 PM
Friend of Wrox
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts

you might want to issue a rs.MoveFirst statement before the MsgBox - see how that goes.

I am a loud man with a very large hat. This means I am in charge
Reply With Quote
  #3 (permalink)  
Old November 6th, 2004, 11:49 AM
Aal Aal is offline
Authorized User
Join Date: Oct 2004
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts

rs.open "SELECT COUNT(*) AS QTT FROM EMPLOYEE" , ConnectionObject
if not ra.EOF then
   msgbox rs!QTT
end if

Reply With Quote
  #4 (permalink)  
Old November 11th, 2004, 08:32 AM
Authorized User
Join Date: Oct 2004
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Gaz LG Danha

If all else fails, try creating a separate VARIABLE were you can save the value of RS.FIELDS(0).VALUE and the;

It Ends Here
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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
Random record from objRS - why is EOF or BOF True? jfrizelle Classic ASP Databases 0 February 5th, 2008 06:24 AM
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 06:07 PM

All times are GMT -4. The time now is 03:34 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.