MFC ADO连接数据库中_ConnetionPtr _RecordsetPtr _CommandPtr是怎么一回事?
时间:2011-12-26
来源:互联网
MFC ADO连接数据库中_ConnetionPtr _RecordsetPtr _CommandPtr是怎么一回事?
在stdafx.cpp中定义一个变量,再在stdafx.h中用extern声明一下,就可以当全局变量用
为什么对这三个做同样的事,结果:
error C2146: syntax error : missing ';' before identifier 'pConnetion'
1>d:\study\vc\em-system\em-system\sql.h(6) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\study\vc\em-system\em-system\sql.h(6) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\study\vc\em-system\em-system\sql.h(7) : error C2146: syntax error : missing ';' before identifier 'pRecordset'
1>d:\study\vc\em-system\em-system\sql.h(7) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\study\vc\em-system\em-system\sql.h(7) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\study\vc\em-system\em-system\sql.h(8) : error C2146: syntax error : missing ';' before identifier 'pCommand'
1>d:\study\vc\em-system\em-system\sql.h(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\study\vc\em-system\em-system\sql.h(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
更可气的是,同样的程序,一点都没变,改前正常,改后变成上述情况,再改回来, 而且我非常确定改的和原先的一样,但就依旧爆出上述错误!编译清理冲编译重启VS2008重启电脑甚至换了msado15.dll都没用。他说缺少;,没有的事!
在stdafx.cpp中定义一个变量,再在stdafx.h中用extern声明一下,就可以当全局变量用
为什么对这三个做同样的事,结果:
error C2146: syntax error : missing ';' before identifier 'pConnetion'
1>d:\study\vc\em-system\em-system\sql.h(6) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\study\vc\em-system\em-system\sql.h(6) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\study\vc\em-system\em-system\sql.h(7) : error C2146: syntax error : missing ';' before identifier 'pRecordset'
1>d:\study\vc\em-system\em-system\sql.h(7) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\study\vc\em-system\em-system\sql.h(7) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\study\vc\em-system\em-system\sql.h(8) : error C2146: syntax error : missing ';' before identifier 'pCommand'
1>d:\study\vc\em-system\em-system\sql.h(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\study\vc\em-system\em-system\sql.h(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
更可气的是,同样的程序,一点都没变,改前正常,改后变成上述情况,再改回来, 而且我非常确定改的和原先的一样,但就依旧爆出上述错误!编译清理冲编译重启VS2008重启电脑甚至换了msado15.dll都没用。他说缺少;,没有的事!
作者: wozuiqiangdeaoyi 发布时间: 2011-12-26
需要放在#import后面,因为_ConnetionPtr _RecordsetPtr _CommandPtr不是MFC的类类型,是用#import导入生成的COM数据类型。
作者: zyq5945 发布时间: 2011-12-26
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28