表里没有记录呀。呵呵检查一些rs.eof 和 rs.bof

解决方案 »

  1.   

    try
    {
    //database operation
    ...
    }
      catch(_com_error &e)
      {
          _bstr_t bstrSource(e.Source());
          _bstr_t bstrDescription(e.Description());
          printf("\nCOM error occurred, Source : %s \n Description : %s \n",(LPCSTR)bstrSource,(LPCSTR)bstrDescription);
        PrintProviderError(Conn1);
      }
    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);
          }
      }
    }
      

  2.   

    use OutputDebugString to print our debug message, use DebugViewer(http://www.sysinternals.com) to see those message, or you can debug your COM in VC to see what happens. refer to http://www.csdn.net/Develop/read_article.asp?id=6490