控制台程序里面使用数据库的问题
控制台程序选择了支持MFC
使用带MFC的consol程序
在stdafx.h中引入:
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")
然后再tmain中使用
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
结果
F:\try\regedit\ReadPolicy_con\ReadPolicy_con.cpp(22) : error C2065: 'AfxSocketInit' : undeclared identifier