If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Count Query results in EOF

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-12-04, 07:29
jigar_1676 jigar_1676 is offline
Registered User
 
Join Date: Feb 2004
Location: India
Posts: 22
Count Query results in EOF

HI,

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
__________________
Regards,
Jigar Bhavsar
Reply With Quote
  #2 (permalink)  
Old 04-12-04, 10:02
SCIROCCO SCIROCCO is offline
Registered User
 
Join Date: Mar 2004
Location: www.scirocco.ca
Posts: 346
Re: Count Query results in EOF

Try naming the field count i.e.

rs.open "SELECT COUNT(*) AS EmployeeCount FROM EMPLOYEE" , ConnectionObject
__________________
http://www.scirocco.ca/images/banner...occobanner.gif

Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

Or try our Ask An Expert service to answer any of your questions!
Reply With Quote
  #3 (permalink)  
Old 04-12-04, 10:05
jigar_1676 jigar_1676 is offline
Registered User
 
Join Date: Feb 2004
Location: India
Posts: 22
Unhappy

I have tried with alias name, but it is throwing the same error.

Appart from this, If I write "SELECT * FROM EMPLOYEE", it returns the same error...
__________________
Regards,
Jigar Bhavsar
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
Pingbacks are On
Refbacks are On