type redefinition Error after Import ADO in vc++

Correct Implementation of #import
It is important to invoke ADO correctly in your program, or you can have compiler errors. The following code demonstrates the correct way to use #import with Msado10.dll the MSADO15.dll:

#import <msado15.dll>            \
no_namespace                     \
rename( "EOF", "adoEOF" )

error C2011: 'EditModeEnum' : 'enum' type redefinition
error C2011: 'LockTypeEnum' : 'enum' type redefinition
error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
error C2011: 'DataTypeEnum' : 'enum' type redefinition
error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition
error C2011: 'RecordStatusEnum' : 'enum' type redefinition

Here's the original solution in MSDN:
http://support.microsoft.com/kb/169496/EN-US/

posted on 2007-08-30 18:39  Wade  阅读(1548)  评论(0编辑  收藏  举报

导航