ADO编程:error C2011: 'LockTypeEnum' : 'enum' type redefinition
解决方法一
// Import the ADO type library
#import "C:\\Program Files\\Common Files\\system\\ado\\msadox.dll"
#import "C:\\Program Files\\Common Files\\System\\ado\\msado15.dll" no_namespace rename ("EOF","adoEOF")
解决方法二
// 1)
#pragma warning(disable:4146)
#import "C:/Program Files/Common Files/System/ADO/msado15.dll" named_guids rename("EOF","adoEOF"), rename("BOF","adoBOF")
#pragma warning(default:4146)
using namespace ADODB;
// 2)
#pragma warning(disable:4146)
#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")
解决方法三
最终有效的方法:(VC++6.0)Project ->Setting -> C/C++ ->perprocessor ->perprocessor definitions : 里面添加 宏 _AFX_NO_DAO_SUPPORT