C++ Code
1
2 3 |
// 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") |
以下网上流传的方法,被转来转去,然而试了没啥作用!
C++ Code
1
2 3 4 5 6 7 8 9 10 11 12 13 |
// 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