DAO问题:Unrecognized database format

来源:互联网 发布:js获取单选框选中状态 编辑:程序博客网 时间:2024/05/17 01:18
If you are linking with the MFC DLL, you can specify that you want MFCto use DAO 3.6 by inserting the following line of code before you openan Access 2000 database:

AfxGetModuleState()->m_dwVersion = 0x0601;


Insert this line in the CYourApp::Initinstance() function of your program.

If you are building with the static MFC libraries, following are the steps to get static builds of MFC to use DAO 3.6:
1. Modify the Daocore.cpp file in the MFC SRC directory. You will receive the following comment:

// Determine whether to use DAO 3.6, 3.5, or 3.0
// Use DAO 3.0 if DLL build and not built with MFC 4.21 or later
// Use DAO 3.6 if MFC 6.01 or later
// otherwise, DAO 3.5



Add the following lines:

#undef _MFC_VER
#define _MFC_VER 0x0601



2.Rebuild the library for the variant you need. For example, to build thestatic MFC library, debug version, non-Unicode, with no browser filesuse the following command at the command prompt in the MFC/SRC folder:

nmake DEBUG=1


for release:
nmake DEBUG=0


for unicode builds:
nmake DEBUG=1 UNICODE=1
nmake DEBUG=0 UNICODE=1
原创粉丝点击