VC2008下连接数据库出错
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace
rename("EOF", "adoEOF")
#import "c:\program files\common files\system\ado\msado15.dll" named_guids rename_namespace("ADOCG") rename("EOF", "EndOfFile") rename("BOF","FirstOfFile")
using namespace ADOCG;
[解决办法]
/ /特殊情况下,DLL假设调用应用程序初始化OLE。
//对于DLL没有特殊情况下,这些DLL需要初始化OLE通过oleInitialise
// 上述被完成由于MFC不能提供自动取消DLL,因为OLE在DLL_PROCESS_DETACH情况下,关闭它是无效的
// Special case DLL context to assume that the calling app initializes OLE.
// For DLLs where this is not the case, those DLLs will need to initialize
// OLE for themselves via OleInitialize.
//This is done since MFC cannot provide
automatic uninitialize for DLLs because it is not valid to shutdown OLE
during a DLL_PROCESS_DETACH.