ADODB错误解决办法

错误如下:

MSJRO.tlh(100) : error C2146: syntax error : missing ';' before identifier 'ConflictTables'
MSJRO.tlh(100) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
MSJRO.tlh(100) : error C2501: 'ConflictTables' : missing storage-class or type specifiers
MSJRO.tlh(128) : error C2146: syntax error : missing ';' before identifier 'GetConflictTables'
MSJRO.tlh(128) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
MSJRO.tli(43) : error C2143: syntax error : missing ';' before 'tag::id'
MSJRO.tli(43) : error C2433: '_RecordsetPtr' : 'inline' not permitted on data declarations
MSJRO.tli(43) : error C2501: '_RecordsetPtr' : missing storage-class or type specifiers
MSJRO.tli(43) : fatal error C1004: unexpected end of file found

原来头文件相关代码是这样:
#pragma warning (disable: 4146)
// CG : In order to use this code against a different version of ADO, the appropriate
// ADO library needs to be used in the #import statement
#pragma message ("Make sure you go to Tools.Options.Directories.Library files and add the paths to msado15.dll and msjro.dll will usually be in C:\\Program Files\\Common Files\\System\\ado")
//#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 rename("ReplicaTypeEnum", "_ReplicaTypeEnum") 

#import <msado15.dll> rename("EOF", "EndOfFile")
#import <MSJRO.DLL> no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum") 

需要在路径中设置 C:\Program Files\Common Files\System\ado\

解决方案:
从系统中拷贝msado15.dll,msjro.dll,放入数据库头文件同目录下,修改头文件:

#import "msado15.dll" rename("EOF", "EndOfFile")
#import "MSJRO.DLL" no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum") 

测试正常。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值