#endif // _AFXDLL AfxDaoInit(); //AfxGetModuleState 是对dao 350,360对access2000的兼容性设置 BOOL CMisApp::InitInstance() 在这上加上就行了不过要用MFC 的DLL 才行要用LIB 要从新编译 MFC 类库 不过我的没编译通MSDN 中有说明 Using Access 2000 Databases with MFC 6.0. MFC 6.0 has the ability to use Microsoft Access 2000 databases. To engage this support in your application, you must enable DAO 3.6 by: Linking with the DLL version of MFC and adding the following line to InitInstance before you make any database-related calls: AfxGetModuleState()->m_dwVersion = 0x0601 - or - Recompile the MFC static libs with _MFC_VER set to 0x0601. FIX: DAO 3.6 Causes Debug Errors in MFC DAO Non-Unicode Builds [visualc]
#define _MFC_VER 0x0601 #ifdef _AFXDLL
AfxGetModuleState()->m_dwVersion = 0x0601;
#else
#endif // _AFXDLL
AfxDaoInit();
//AfxGetModuleState 是对dao 350,360对access2000的兼容性设置
BOOL CMisApp::InitInstance()
在这上加上就行了不过要用MFC 的DLL 才行要用LIB
要从新编译 MFC 类库
不过我的没编译通MSDN 中有说明
Using Access 2000 Databases with MFC 6.0.
MFC 6.0 has the ability to use Microsoft Access 2000 databases. To engage this support in your application, you must enable DAO 3.6 by:
Linking with the DLL version of MFC and adding the following line to InitInstance before you make any database-related calls: AfxGetModuleState()->m_dwVersion = 0x0601
- or -
Recompile the MFC static libs with _MFC_VER set to 0x0601.
FIX: DAO 3.6 Causes Debug Errors in MFC DAO Non-Unicode Builds [visualc]
MSN:[email protected]
找到里面的连接字符串,再改用ADO就可以了.