Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    India
    Posts
    22

    Unanswered: 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

  2. #2
    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!

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •