Chinaunix

标题: [求助]VC++6.0使用ADO动态创建ACCESS数据库问题 [打印本页]

作者: 我好麻烦    时间: 2006-06-26 14:53
标题: [求助]VC++6.0使用ADO动态创建ACCESS数据库问题
各位好:

小弟今天又要来麻烦大家了,请大家表B4偶.

在STDAFX.H头文件中引入了msadox.dll和msado15.dll文件.
#pragma warning(disable:4146)
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF","adoEOF"
#import "c:\program files\common files\system\ado\msadox.dll"
#pragma warning(default:4146)

在MyDlg实现文件中的代码如下:
void CMyDlg::OnButton3()
{
        // TODO: Add your control notification handler code here
        create table s(wd not null, et not null,CONSTRAINT wd Primary Key(wd));
        CString strcnn="rovider=Microsoft.Jet.OLEDB.4.0;Data source=s.mdb";
        try
        {
                ADOX::_CatalogPtr pCat=NULL;
                hr=pCat.CreateInstance(__uuidof (ADOX::_Catalog));
                if(FAILED(wd))
                {
                        _com_issue_error(wd);
                }else
                {
                        pCat->Create(_bstr_t(strcnn));
                }
        }
        catch(_com_error &e)
        {
                AfxMessageBox(_T("error");
        }
}

编译生成,出现5个错误:
stdafx.cpp
e:\bennyboa\vc++ project\ben\ben\debug\msadox.tli(246) : error C2511: 'Append' : overloaded member function 'long (const class _variant_t &,enum ADOX:ataTypeEnum,long)' not found in 'ADOX::Columns'
        e:\bennyboa\vc++ project\ben\ben\debug\msadox.tlh(350) : see declaration of 'Columns'
e:\bennyboa\vc++ project\ben\ben\debug\msadox.tli(346) : error C2556: 'enum ADOX:ataTypeEnum __thiscall ADOX::_Column::GetType(void)' : overloaded function differs only by return type from 'enum DataTypeEnum __thiscall ADOX::_Column::GetType(void)
'
        e:\bennyboa\vc++ project\ben\ben\debug\msadox.tlh(444) : see declaration of 'GetType'
e:\bennyboa\vc++ project\ben\ben\debug\msadox.tli(346) : error C2371: 'GetType' : redefinition; different basic types
        e:\bennyboa\vc++ project\ben\ben\debug\msadox.tlh(444) : see declaration of 'GetType'
e:\bennyboa\vc++ project\ben\ben\debug\msadox.tli(34 : error C2664: 'get_Type' : cannot convert parameter 1 from 'enum ADOX:ataTypeEnum *' to 'enum DataTypeEnum *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
e:\bennyboa\vc++ project\ben\ben\debug\msadox.tli(353) : error C2511: 'PutType' : overloaded member function 'void (enum ADOX:ataTypeEnum)' not found in 'ADOX::_Column'
        e:\bennyboa\vc++ project\ben\ben\debug\msadox.tlh(392) : see declaration of '_Column'

现在告不明白是怎么回事情了,谁能帮帮我啊?????谢谢了
作者: 我好麻烦    时间: 2006-06-26 15:26
Who could help me?

No response?
作者: 我好麻烦    时间: 2006-06-27 09:19
么人回啊????faint
作者: shixinxing    时间: 2008-04-22 22:17
标题: 回复 #1 我好麻烦 的帖子
问题后来怎么解决的
我也遇到了




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2