CString strConnection;
strConnection.Format("Provider=OraOLEDB.Oracel;Password=%s;User ID=%s;Data Source=%s;Persist Security Info=TRUE;","thh129111","system","thw");
hr=m_pConnection.CreateInstance(_uuidof(Connection));
if(SUCCEEDED(hr))
{
hr=m_pConnection->Open(_bstr_t(strConnection)," "," ",adConnectUnspecified);
}
上面是我的连接程序,运行后总是出现"unknown error 0x80010e7a"的错误.上网找了一下,有人说在oracle目录下加个internet账户就可以了.可我加了之后也没好.
请高手指教.

解决方案 »

  1.   

    把你的代码换成如下:"Provider=OraOLEDB.Oracle;Password=%s;Persist Security Info=True;User ID=%s;Data Source=%s"
    CString strConnection; 
    strConnection.Format("Provider=OraOLEDB.Oracle;Password=%s;Persist Security Info=True;User ID=%s;Data Source=%s"); 
    hr=m_pConnection.CreateInstance(_uuidof(Connection)); 
    if(SUCCEEDED(hr)) 
    {
    hr=pConnection->Open(strCon,"","",NULL);

      

  2.   

    为什么不试试Pro *C/C++这样的方式呢?