在stafx.h中添加
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace
rename("EOF", "adoEOF")
错误提示:
1>d:\documents\codes\ch15demo1\ch15demo1\debug\msado15.tlh(2373) : error C2059: 语法错误 : “<L_TYPE_raw>”
1>d:\documents\codes\ch15demo1\ch15demo1\debug\msado15.tlh(2373) : error C2238: 意外的标记位于“;”之前
1>d:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxv_w32.h(16) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
解决办法如下:
#import "c:\program files\common files\system\ado\msado15.dll" named_guids rename_namespace("ADOCG") rename("EOF", "EndOfFile") rename("BOF","FirstOfFile")
using namespace ADOCG;
添加到stafx.h的最后面
using namespace ADOCG;
添加到stafx.h的最后面