PSS ID Number: Q147948
Article Last Modified on 08-3-2001
Running an application that uses the MFC DAO classes from Visual C++ version 4.0 or 4.1 to retrieve CLongBinary data from a database may result in one or more of the following behaviors when performing a recordset move or requery:
-or-Access violations
"Out of memory" exceptions
There is a programming error in the MFC code that can lead to this behavior: GlobalReAlloc is incorrectly used. The return value of GlobalReAlloc is not used, so the global handle embedded in the CLongBinary recordset member variable becomes invalid if GlobalReAlloc moves the virtual memory block. For more information, refer to the MFC source code in Daodfx.cpp of the Mfc\Src directory, and look at the use of GlobalReAlloc in the AllocLongBinary() function.
There are two steps to resolving this problem. Both must be performed in order to reliably work around this issue.
Daoclb.exeFor more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
Q119591 How to Obtain Microsoft Support Files from Online Services
Microsoft 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.
Additional query words: kbVC400bug 4.00 4.10 4.20 softlib software library
Keywords: kbDAOsearch kbDatabase kbMFC kbVC kbVC420fix
Issue Type:
Technology: kbAudDeveloper kbMFC