在DLL中使用ADO连接数据库的问题
1 |
但是在编译的时候会报如下错误:
error C2011: ‘’’’LockTypeEnum’’’’ : ‘’’’enum’’’’ type redefinition
error C2011: ‘’’’DataTypeEnum’’’’ : ‘’’’enum’’’’ type redefinition
error C2011: ‘’’’FieldAttributeEnum’’’’ : ‘’’’enum’’’’ type redefinition
error C2011: ‘’’’EditModeEnum’’’’ : ‘’’’enum’’’’ type redefinition
error C2011: ‘’’’RecordStatusEnum’’’’ : ‘’’’enum’’’’ type redefinition
在网上查找最终使用如下方法解决:
在stdafx.h中使用如下字符串.1
2
3
4
5
6
7
rename("EOF","adoEOF")rename("BOF","adoBOF") \
rename("DataTypeEnum","adoDataTypeEnum") \
rename("FieldAttributeEnum", "adoFielAttributeEnum") rename("EditModeEnum", "adoEditModeEnum") \
rename("LockTypeEnum", "adoLockTypeEnum") rename("RecordStatusEnum", "adoRecordStatusEnum") \
rename("ParameterDirectionEnum", "adoParameterDirectionEnum") //导入ADO动态连接库
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 张拓的博客!