void CADOParameter::dump_com_error(_com_error &e) { TCHAR ErrorStr[1024]; _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); swprintf(ErrorStr,sizeof(ErrorStr)/sizeof(ErrorStr[0]), _T("cmADOParameter Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n"), e.Error(), e.ErrorMessage(), (LPCTSTR)bstrSource, (LPCTSTR)bstrDescription ); m_strLastError = ErrorStr; m_dwLastError = e.Error(); throw CADOException(e.Error(), e.Description()); }
void CADOParameter::dump_com_error(_com_error &e) { CString ErrorStr; _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); ErrorStr.Format( "CADOParameter Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n", e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription ); m_strLastError = ErrorStr; m_dwLastError = e.Error(); #ifdef _DEBUG AfxMessageBox(ErrorStr, MB_OK | MB_ICONERROR); #endif throw CADOException(e.Error(), e.Description()); }
void CADORecordset::dump_com_error(_com_error &e) { CString ErrorStr; _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); ErrorStr.Format( "CADORecordset Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n", e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription ); ErrorStr.Format( "Error Code = %08lx\n\t %s\n", e.Error(), (LPCSTR)bstrDescription ); m_strLastError = _T("Query = " + GetQuery() + " " + (LPCSTR)bstrDescription); m_dwLastError = e.Error(); #ifdef _DEBUG AfxMessageBox( ErrorStr, MB_OK | MB_ICONERROR ); #endif throw CADOException(e.Error(), m_strLastError); }
void CADODatabase::dump_com_error(_com_error &e) { CString ErrorStr; _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); ErrorStr.Format( "CADODataBase Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n", e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription); m_strErrorDescription = (LPCSTR)bstrDescription ; m_strLastError = _T("Connection String = " + GetConnectionString() + '\n' + ErrorStr); m_dwLastError = e.Error(); #ifdef _DEBUG AfxMessageBox(ErrorStr, MB_OK | MB_ICONERROR ); #endif throw CADOException(e.Error(), e.Description()); }
void CADOCommand::dump_com_error(_com_error &e) { CString ErrorStr; _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); ErrorStr.Format( _T("CADOCommand Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n"), e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription ); m_strLastError = ErrorStr; m_dwLastError = e.Error(); #ifdef _DEBUG AfxMessageBox(ErrorStr, MB_OK | MB_ICONERROR); #else g_log.Trace(LOGL_HIG, LOGC_ERROR, __TFILE__, __LINE__, bstrDescription) ; #endif throw CADOException(e.Error(), e.Description()); }