Microsoft KB Archive/138872

= FIX: TRACE Message Appears When Closing DAO Objects =

Article ID: 138872

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 4.0 Professional Edition

 Microsoft Visual C++ 4.1 Subscription

 Microsoft Visual C++ 5.0 Learning Edition 

-

<div class="notice_section">

This article was previously published under Q138872

<div class="symptoms_section">

SYMPTOMS
The MFC DAO classes provide warning messages to the debug output window when appropriate. This tracing can be turned off by disabling the database tracing by using the Tracer utility. However, two possible problems exist:

 An MFC AppWizard-generated DAO application may display the following TRACE message in the Output Window of the debugger:

Warning: call Close before destructing Recordset

This message can safely be ignored. The destructor for the CDaoRecordset class will clean up properly.</li> A bug in the debug tracing will incorrectly display the offending module and line of code for _UNICODE builds. There are some TRACE calls in Daocore.cpp in the AfxDaoCheck and AfxDaoTrace functions, which incorrectly use a %s specifier with ANSI strings. This doesn't work in a _UNICODE build, so you are likely to get random characters. These calls should use %hs to force ANSI. As a workaround, rebuild the debug versions of the MFC libraries to use %hs instead of %s. The release versions of the MFC libraries are unaffected by this because TRACE calls are eliminated from release builds.</li></ul>

The information is located in the Readme for Microsoft Visual C++.

<div class="status_section">

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual C++ version 4.2.

Additional query words: kbVC400bug

Keywords: kbbug kbdatabase kbfix kbvc420fix KB138872

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.