FIX: Assertion Or Failure With CDaoDatabase::CreateRelation Method

Article translations Article translations
Article ID: 217216 - View products that this article applies to.
This article was previously published under Q217216
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

SYMPTOMS

A GPF or assertion occurs when using CDaoDatabase::CreateRelation method against Access 2000 database with Visual C++ version 6.0.

CAUSE

Microsoft confirms that this behavior is due to a bug in the CDaoDatabase::CreateRelation() method in DAO 3.6. The implementation of this method can be found in Daocore.cpp.

In the CDaoDatabase::CreateRelation() method, a DAOFields pointer and a DAOField pointer is declared. In addition, the DAOFields collection is looped through, and the DAOField pointer is used to access a field in the DAOFields collection, and then release is called. At the end of the method, the following check is implemented:
if (pDAOField != NULL)
	    pDAOField->Release();

Since pDAOField was used as a temporary it is not set to NULL. As a result, the Release() call draws an assertion in the DAO360.DLL implementation of Release() stating that Release() was called too many times. Consequently, Release() cannot set the pointer (pDAOField) that referenced it to NULL.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

Visual Studio 6.0 Service Pack 3 included the DAO 3.60 bits as part of the MDAC 2.1 SP1 stack, which fixes this error.

MORE INFORMATION

To compile with the MFC run time version of 0x0601 and load DAO 3.60, reference the following article in the Microsoft Knowledge Base:
236991 PRB: Unrecognized Database Format Error with Access 2000 Database

Properties

Article ID: 217216 - Last Review: October 14, 2013 - Revision: 1.0
APPLIES TO
  • Microsoft Visual C++ 6.0 Enterprise Edition
Keywords: 
kbnosurvey kbarchive kbbug kbfix kbmdacnosweep kbvs600sp3fix KB217216

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com