FIX: Assertion Failure After Using CDaoWorkspace::Create()Last reviewed: September 19, 1997Article ID: Q143408 |
4.00 4.10
WINDOWS NT
kbprg kbbuglist kbfixlist
The information in this article applies to:
SYMPTOMSUsing a CDaoWorkspace object after calling the CDaoWorkspace::Create() function may cause an assertion failure in Daocore.cpp line 651 inside the CDaoWorkspace::Open() function.
CAUSEWhen a newly created CDaoWorkspace object is used for the first time, the CDaoWorkspace::Open() function is called. This function should only be called to retrieve either a named workspace or the default workspace from the workspaces collection. MFC relies on the value of the m_bOpen member variable to determine if the workspace object's Open() function needs to be called. This member variable is set to TRUE only inside the Open() and Append() member functions.
RESOLUTIONCall CDaoWorkspace::Append() before using a newly created workspace object.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++, 32-bit Edition, version 4.2.
MORE INFORMATION
Sample CodeCDaoWorkspace wsp; wsp.Create(_T("NewWorkspace"), _T("admin"), _T("")); // Call Append() to set the m_bOpen flag. // This will also append the workspace to the engine's workspaces // collectionwsp.Append(); CDaoDatabase db(&wsp); db.Open(_T("c:\\path\\to\\mdbfile.mdb"), FALSE, FALSE, NULL); ...
|
Additional reference words: 4.00 4.10 vcbuglist400 vcfixlist420
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |