首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

动态链接库连接数据库有关问题

2012-03-13 
动态链接库连接数据库问题我做了一个动态链接库想通过ADO调用数据库,当我把#importc:\programfiles\commo

动态链接库连接数据库问题
我做了一个动态链接库想通过ADO调用数据库,当我把#import       "c:\program       files\common       files\system\ado\msado15.dll "       \      
    no_namespace       \      
    rename       ( "EOF ",       "adoEOF ")加入到stdafx.h后编译出现错误:      
    e:\servicecomment\debug\msado15.tlh(171)       :       error       C2011:       'LockTypeEnum '       :       'enum '       type       redefinition      
    e:\servicecomment\debug\msado15.tlh(214)       :       error       C2011:       'DataTypeEnum '       :       'enum '       type       redefinition      
    e:\servicecomment\debug\msado15.tlh(258)       :       error       C2011:       'FieldAttributeEnum '       :       'enum '       type       redefinition      
    e:\servicecomment\debug\msado15.tlh(279)       :       error       C2011:       'EditModeEnum '       :       'enum '       type       redefinition      
    e:\servicecomment\debug\msado15.tlh(287)       :       error       C2011:       'RecordStatusEnum '       :       'enum '       type       redefinition      
    e:\servicecomment\debug\msado15.tlh(407)       :       warning       C4146:       unary       minus       operator       applied       to       unsigned       type,       result       still       unsigned      
    e:\servicecomment\debug\msado15.tlh(530)       :       error       C2011:       'ParameterDirectionEnum '       :       'enum '       type       redefinition      
       
    这是什么原因?

[解决办法]
#import "msado15.dll " no_namespace \
rename( "EOF ", "EndOfFile ") \
rename( "LockTypeEnum ", "newLockTypeEnum ") \
rename( "DataTypeEnum ", "newDataTypeEnum ") \
rename( "FieldAttributeEnum ", "newFieldAttributeEnum ") \
rename( "EditModeEnum ", "newEditModeEnum ") \
rename( "RecordStatusEnum ", "newRecordStatusEnum ") \
rename( "ParameterDirectionEnum ", "newParameterDirectionEnum ")

热点排行