PRB: HENV Not Accessible When Using MFC ODBC ClassesLast reviewed: August 7, 1997Article ID: Q167910 |
The information in this article applies to:
SYMPTOMSWhen you dynamically link to MFC, the MFC ODBC classes use an ODBC environment handle (HENV) that is declared local to the MFC DLL. Therefore, applications using the MFC DLL cannot access MFC's HENV.
CAUSEThese classes were not designed to make the HENV available to the programmer.
RESOLUTIONIf you need access to the HENV, link MFC statically and use the code below.
STATUSMicrosoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Sample Code
#include "c:\\msdev\\mfc\\src\\dbimpl.h" _AFX_DB_STATE* pDbState = _afxDbState; // call ODBC API functions using pDbState->m_henvAllConnections Keywords : MfcDatabase kbinterop Technology : kbMfc Version : 4.2 4.2b 5.0 Platform : NT WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |