Spurious warning: CRecordset not found in m_pDatabase->m_listRecordsets. - by Steve Wolf

Status : 


Sign in
to vote
ID 771630 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 11/19/2012 10:45:15 AM
Access Restriction Public


CRecordset::Close() issues incorrect TRACE message if it is not open: "WARNING: CRecordset not found in m_pDatabase->m_listRecordsets."

When a CRecordset has been opened, then it is registered with its associated CDatabase (and hence is added to m_listRecordsets).

However, if it is not open (or is never opened), then it is NOT registered with the database.

This is not an error - this is by design.  No open = no registration = should not be warning me about it.

It's just one more spurious, time-wasting thing to ignore in the trace output, that has to be verified every year or so to remind everyone that "no, there is nothing wrong with the database code, just some overzealous programmer at MS putting out a spurious warning message."
Sign in to post a comment.
Posted by Microsoft on 12/4/2012 at 11:16 AM
Hello Steve,

Thanks for the report. We have investigated and found that this issue is by design. The TRACE message is output because the CDatabase was not open when the CRecordset was associated with it, so the CRecordset was not added to the m_listRecordsets list (see the CRecordset constructor). The TRACE message is merely trying to alert you to this fact. I don't see any reason to change the behavior of the TRACE message in this scenario.

Pat Brenner
Visual C++ Libraries Development.
Posted by Microsoft on 11/26/2012 at 11:13 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 11/19/2012 at 9:57 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. In order to efficiently investigate and reproduce this issue, we are requesting a demo project. Please submit this information to us within 3 business days. We look forward to hearing from you with this information.
Posted by Macy [MSFT] on 11/19/2012 at 10:52 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)