VC连接ACCESS数据库出现的问题

来源:互联网 发布:广告图设计软件 编辑:程序博客网 时间:2024/05/01 17:15


1>------ Build started: Project: CallRecord, Configuration: Debug Win32 ------
1>Compiling...
1>stdafx.cpp
1>e:\vc_code\commassist\callrecord\debug\msado15.tlh(297) : error C2011: 'LockTypeEnum' : 'enum' type redefinition
1>        c:\program files\microsoft sdks\windows\v6.0a\include\dbdaoint.h(109) : see declaration of 'LockTypeEnum'
1>e:\vc_code\commassist\callrecord\debug\msado15.tlh(345) : error C2011: 'DataTypeEnum' : 'enum' type redefinition
1>        c:\program files\microsoft sdks\windows\v6.0a\include\dbdaoint.h(138) : see declaration of 'DataTypeEnum'
1>e:\vc_code\commassist\callrecord\debug\msado15.tlh(390) : error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
1>        c:\program files\microsoft sdks\windows\v6.0a\include\dbdaoint.h(127) : see declaration of 'FieldAttributeEnum'
1>e:\vc_code\commassist\callrecord\debug\msado15.tlh(412) : error C2011: 'EditModeEnum' : 'enum' type redefinition
1>        c:\program files\microsoft sdks\windows\v6.0a\include\dbdaoint.h(83) : see declaration of 'EditModeEnum'
1>e:\vc_code\commassist\callrecord\debug\msado15.tlh(421) : error C2011: 'RecordStatusEnum' : 'enum' type redefinition
1>        c:\program files\microsoft sdks\windows\v6.0a\include\dbdaoint.h(341) : see declaration of 'RecordStatusEnum'
1>e:\vc_code\commassist\callrecord\debug\msado15.tlh(685) : error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition
1>        c:\program files\microsoft sdks\windows\v6.0a\include\dbdaoint.h(326) : see declaration of 'ParameterDirectionEnum'
1>Build log was saved at "file://e:\vc_code\commassist\CallRecord\Debug\BuildLog.htm"
1>CallRecord - 6 error(s), 0 warning(s)


解决:

在 stdafx.h中 添加:

#import "C:/Program Files/Common Files/System/ado/msado15.dll"no_namespace \
rename("EOF","adoEOF") rename("DataTypeEnum","adoDataTypeEnum")\
rename("FieldAttributeEnum", "adoFielAttributeEnum") rename("EditModeEnum", "adoEditModeEnum") \
rename("LockTypeEnum", "adoLockTypeEnum") rename("RecordStatusEnum", "adoRecordStatusEnum")\
rename("ParameterDirectionEnum", "adoParameterDirectionEnum")

0 0
原创粉丝点击