//VC连接ORACLE9I数据库
m_pConnection->Open(".....","","",adModeUnknown);
//成功。
//向库中写记录也成功m_pConnection->BeginTran();
。//
//数据处理。添加记录m_pConnection->CommitTran();
事物提交时出错。
为什么???

解决方案 »

  1.   

    VOID  PrintProviderError(ADODB::_ConnectionPtr  pConnection)  
    {  
       //  Print  Provider  Errors  from  Connection  object.  
       //  pErr  is  a  record  object  in  the  Connection's  Error  collection.  
                   ADODB::ErrorPtr    pErr  =  NULL;  
       long            nCount  =  0;  
       long            i  =  0;  
     
       if(  (pConnection->Errors->Count)  >  0)  
       {  
               nCount  =  pConnection->Errors->Count;  
               //  Collection  ranges  from  0  to  nCount  -1.  
               for(i  =  0;  i  <  nCount;  i++)  
               {  
                   pErr  =  pConnection->Errors->GetItem(i);  
                   printf("\n\t  Error  number:  %x\t%s",  pErr->Number,  (LPCSTR)pErr->Description);  
               }  
       }  
    }