vs2010 sql2008 引入ado.h,ado.cpp类库之后出现msjro.tlh(196): error C2146: 语法错误: 缺少“;”

y7429949 2012-07-30 02:08:46
使用VS2010和sql2008数据库,使用ado2 类开发应用程序,编译时提示如下错误,如何解决????
>\msjro.tlh(196): error C2146: 语法错误: 缺少“;”(在标识符“ConflictTables”的前面)
\msjro.tlh(196): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
\msjro.tlh(196): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
\msjro.tlh(224): error C2146: 语法错误: 缺少“;”(在标识符“GetConflictTables”的前面)
\msjro.tlh(224): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
\msjro.tlh(224): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
\msjro.tlh(224): warning C4183: “GetConflictTables”: 缺少返回类型;假定为返回“int”的成员函数
\msjro.tli(111): error C2143: 语法错误 : 缺少“;”(在“IReplica::GetConflictTables”的前面)
\msjro.tli(111): error C2433: “_RecordsetPtr”: 不允许在数据声明中使用“inline”
\msjro.tli(111): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
\msjro.tli(111): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
\msjro.tli(115): error C2064: 项不会计算为接受 2 个参数的函数
\ado2.h(145): error C2872: “_RecordsetPtr”: 不明确的符号
我用ado.h ado.cpp,从我现在查到的信息来看应该是msado15.dll和msjro.dll问题,XP系统,求解释
我是添加ADO.H,,,ADO.CPP类库来调用数据库,#import路径就在ADO.H中。以前一直用的好好地。最近才出的问题
...全文
753 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
y7429949 2012-08-02
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 的回复:]

编译错误:
c:\wpds\debug\msjro.tlh(196): error C2146: syntax error : missing ';' before identifier 'ConflictTables'

c:\wpds\debug\msjro.tlh(196): error C2146: 语法错误: 缺少“;”(在标识符“ConflictTables”的前面)

……
[/Quote]
这个问题已经解决了。可能是我把smadl15.dll文件你改了东西。具体我不清楚,反正从别的电脑上拷贝一份过来就OK了。
feitianyux 2012-08-01
  • 打赏
  • 举报
回复
编译错误:
c:\wpds\debug\msjro.tlh(196): error C2146: syntax error : missing ';' before identifier 'ConflictTables'

c:\wpds\debug\msjro.tlh(196): error C2146: 语法错误: 缺少“;”(在标识符“ConflictTables”的前面)

解决:
1. 如果只是用 ADO 不用 Jet 的话,可不 import MSJRO.DLL 模块,将 CJetEngine 相关代码注释掉即可。

2. 将 using namespace ADODB; 放在 import MSJRO.DLL 之前,如:
#import "C:\Program Files\Common Files\System\ado\msado15.dll" rename("EOF", "EndOfFile")
using namespace ADODB;
#import "C:\Program Files\Common Files\System\ado\MSJRO.DLL" no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")
pathuang68 2012-07-31
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

使用ADO前必须在工程的stdafx.h头文件里用直接引入符号#import引入ADO库文件,以使编译器能正确编译。代码如下所示:

用#import引入ADO库文件

#import "c:\program files\common files\system\ado\msado15.dll"no_namespaces rename("EOF" adoEOF")

这行语句声明在工程……
[/Quote]
将其中的“c:\program files\common files\system\ado\msado15.dll”改为你需要的版本。
pathuang68 2012-07-31
  • 打赏
  • 举报
回复
使用ADO前必须在工程的stdafx.h头文件里用直接引入符号#import引入ADO库文件,以使编译器能正确编译。代码如下所示:

用#import引入ADO库文件

#import "c:\program files\common files\system\ado\msado15.dll"no_namespaces rename("EOF" adoEOF")

这行语句声明在工程中使用ADO,但不使用ADO的名字空间,并且为了避免常数冲突,将常数EOF改名为adoEOF。现在不需添加另外的头文件,就可以使用ADO接口了。
y7429949 2012-07-31
  • 打赏
  • 举报
回复
求各位懂得帮忙啊,为这问题纠结好几天了。 ado.h,,,,,ado.cpp,,,,
y7429949 2012-07-31
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]

引用 2 楼 的回复:

使用ADO前必须在工程的stdafx.h头文件里用直接引入符号#import引入ADO库文件,以使编译器能正确编译。代码如下所示:

用#import引入ADO库文件

#import "c:\program files\common files\system\ado\msado15.dll"no_namespaces rename("EOF" adoEO……
[/Quote]
你说的这引入ADO库我都有,在ADO.H中
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" rename("EOF", "EndOfFile")
#import "C:\Program Files\Common Files\System\ado\MSJRO.DLL" no_namespace
应该不是这问题,要是说一定要放在stdafx.h中我也试过。一样的错误。

64,646

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧