web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

The call to the member EOF Failed Error when using ADO Record Set

(0) ShareShare
ReportReport
Posted on by 50,237 Super User 2025 Season 2

I am using ADO Automation to read the data from the another SQL Server, everything is working fine but when there are no rows to return i get the below error. I tried to use the RecordSet.RecordCount but that too gives me an error "Operation is not allowed when the object is closed".  Please let me know if anybody has suggestions to resolve this issue.

2016_2D00_12_2D00_27_5F00_23_2D00_47_2D00_18.png

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Yogesh Kulkarni_ Profile Picture
    1,762 on at
    RE: The call to the member EOF Failed Error when using ADO Record Set

    Suresh, just trying to solve this.

    Dont know whether it applies to your case or not.

    But, you can't close the recordset, because you never actually opened it.

    A Read statement does not return any records, so the recordset will not be opened and on closing it returns an error.

    Please check this if it can help you.

    http://forum.mibuso.com/discussion/51958/ado-recordset-error

    -Yogesh Kulkarni

    Please verify, if you find answer helpful.

  • Verified answer
    Suresh Kulla Profile Picture
    50,237 Super User 2025 Season 2 on at
    RE: The call to the member EOF Failed Error when using ADO Record Set

    Yogesh,

    Thank you for the reply , the error is not happening on close but during the call of EOF or getting the RecordCount. I did try commenting execute command but i still get the same error. It looks like i need to make some change on stored procedure to  SET NO COUNT ON. I don't have access to SP so i will ask tomorrow for that change and will let you know.

    In the meantime if you have any other suggestions please let me know.

  • Verified answer
    Suresh Kulla Profile Picture
    50,237 Super User 2025 Season 2 on at
    RE: The call to the member EOF Failed Error when using ADO Record Set

    We were able to solve this by making changes to the stored procedure, we are getting this error because the stored procedure was returning zero when there are no rows, so we use @@ROWCOUNT to set and execute our query. SET NO COUNT ON and SET NO COUNT OFF will work in some scenarios, it depends more on Stored procedure.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Alexander Ermakov Profile Picture

Alexander Ermakov 2

#2
SC666 Profile Picture

SC666 1

#2
SC666 Profile Picture

SC666 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans