解决方案 »

  1.   

    #import "c:\Program Files\Common Files\system\ado\msadox.dll"
    ADOX::_CatalogPtr pCatalog = NULL;
    pCatalog.CreateInstance(__uuidof (ADOX::Catalog));
    //g_AccessFile是MDB文件的完整路径
    CString strcnn(_T("Provider=Microsoft.JET.OLEDB.4.0;Data source=")+g_AccessFile);
    pCatalog->Create(_bstr_t(strcnn)); //Create MDB
      

  2.   


    如果我的程序里已经引用了#import "c:\program files\common files\system\ado\msado15.dll" \
    no_namespace \
    rename ("EOF", "adoEOF") 的话,再引用c:\Program Files\Common Files\system\ado\msadox.dll"会报错
      

  3.   

    COM-->Microsoft ADO Ext. 6.0 for DDL and Security
    我看到百科说可以这样引用,但是我不知道怎么引用,没有找到引用在哪里
      

  4.   

    #import "F:\Program Files\Common Files\System\ado\msado15.dll" rename("EOF","adoEOF")
    #import "F:\Program Files\Common Files\System\ado\msadox.dll"  rename("EOF","adoxEOF")
    避免接口命名冲突
      

  5.   

    这篇文章是介绍ado的
    不知道是否可以参考
    http://blog.csdn.net/xianglitian/article/details/5617173
      

  6.   

    我引用了,但是会报错,
    e:\未归\hk-h21ct1(待归档)\h21ct1批量标定软件\h21ct1批量标定软件(源代码)\debug\msadox.tli(246) : error C2511: 'Append' : overloaded member function 'long (const class _variant_t &,enum ADOX::DataTypeEnum,long)' not found in 'ADOX::Columns'
            e:\未归\hk-h21ct1(待归档)\h21ct1批量标定软件\h21ct1批量标定软件(源代码)\debug\msadox.tlh(350) : see declaration of 'Columns'
    e:\未归\hk-h21ct1(待归档)\h21ct1批量标定软件\h21ct1批量标定软件(源代码)\debug\msadox.tli(346) : error C2556: 'enum ADOX::DataTypeEnum __thiscall ADOX::_Column::GetType(void)' : overloaded function differs only by return type from 'enum DataTypeEnu
    m __thiscall ADOX::_Column::GetType(void)'
            e:\未归\hk-h21ct1(待归档)\h21ct1批量标定软件\h21ct1批量标定软件(源代码)\debug\msadox.tlh(444) : see declaration of 'GetType'
    e:\未归\hk-h21ct1(待归档)\h21ct1批量标定软件\h21ct1批量标定软件(源代码)\debug\msadox.tli(346) : error C2371: 'GetType' : redefinition; different basic types
            e:\未归\hk-h21ct1(待归档)\h21ct1批量标定软件\h21ct1批量标定软件(源代码)\debug\msadox.tlh(444) : see declaration of 'GetType'
    e:\未归\hk-h21ct1(待归档)\h21ct1批量标定软件\h21ct1批量标定软件(源代码)\debug\msadox.tli(348) : error C2664: 'get_Type' : cannot convert parameter 1 from 'enum ADOX::DataTypeEnum *' to 'enum DataTypeEnum *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    e:\未归\hk-h21ct1(待归档)\h21ct1批量标定软件\h21ct1批量标定软件(源代码)\debug\msadox.tli(353) : error C2511: 'PutType' : overloaded member function 'void (enum ADOX::DataTypeEnum)' not found in 'ADOX::_Column'
            e:\未归\hk-h21ct1(待归档)\h21ct1批量标定软件\h21ct1批量标定软件(源代码)\debug\msadox.tlh(392) : see declaration of '_Column'
    e:\未归\hk-h21ct1(待归档)\h21ct1批量标定软件\h21ct1批量标定软件(源代码)\adojet.h(102) : warning C4005: 'TARGET_IS_NT40_OR_LATER' : macro redefinition
            c:\program files\microsoft visual studio\vc98\include\rpcndr.h(158) : see previous definition of 'TARGET_IS_NT40_OR_LATER'