//引入ADO
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace \
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename ("EOF", "adoEOF")
如果你是用MFC,则首先在stdafx.h中加上:
#import "C:\\Program Files\\Common Files\\system\\ado\\msado15.dll" no_namespace \
rename("EOF","adoEOF")
即可用。如果要求稳妥,可在stdafx.h中加上
#include <comdef.h>
在CXXApp::InitInstance中加上
::AfxOleInit();