请问 First-chance exception at 0x7c59bbf3 in analyze.exe: Microsoft C++ exception: _com_error @ 0x0d0eea58.是什么错误?

解决方案 »

  1.   

    代码如下:
    bool UpdateDBCallData(int mssid,int trkid,char * starttime, char * endtime,char * calloutbegintime,char * calloutendtime,char * calloutnumber,int calltype,const char *section)
     {
    char sqlbuf[512];
    char DBNAME[32]; 
    int i=0;
    short ret;
    SQLHSTMT hstmt;
    SQLAllocHandle(SQL_HANDLE_STMT,hdbc,&hstmt);
    //SQLSetStmtAttr(hstmt, SQL_ATTR_QUERY_TIMEOUT, (void *)CNST_HTMT_EXEC_TIMEOUT, 0); 
    char tmpbuf[32]; memset(sqlbuf,0,512);
    strcpy(DBNAME,"call_data_table");
    sprintf(sqlbuf,"UPDATE %s SET End_timestamp=",DBNAME);
    strcat (sqlbuf,"'");
    strcat (sqlbuf,endtime);
    strcat (sqlbuf,"'");
    strcat (sqlbuf,",call_type=");
    memset(tmpbuf,0,32);
    itoa   (calltype,tmpbuf,10);
    strcat (sqlbuf,tmpbuf);
    sprintf(tmpbuf,",c_id=%d",mssid);
    strcat (sqlbuf,tmpbuf); if(calloutnumber)
    {
    strcat (sqlbuf,",CALLOUT_ID='");
    strcat (sqlbuf,calloutnumber);
    strcat (sqlbuf,"'");
    int callouttype = GetPhoneType(section,calloutnumber);
    memset(tmpbuf,0,10);
    sprintf(tmpbuf,",CALLOUT_TYPE=%d",callouttype);
    strcat (sqlbuf,tmpbuf);

    if(calloutbegintime)
    {
    strcat (sqlbuf,",callout_begintime='");
    strcat (sqlbuf,calloutbegintime);
    strcat (sqlbuf,"'");
    }
    if(calloutendtime)
    {
    strcat (sqlbuf,",callout_endtime='");
    strcat (sqlbuf,calloutendtime);
    strcat (sqlbuf,"'");
    }
    }

    strcat (sqlbuf," where Link_id=");
    itoa   (trkid,tmpbuf,10);
    strcat (sqlbuf,tmpbuf);
    strcat (sqlbuf," AND trim(Begin_timestamp)='");
    strcat (sqlbuf,starttime);
    strcat (sqlbuf,"'"); OutputDebugString(sqlbuf);
    OutputDebugString("\n"); TRY
    {
    ret= SQLExecDirect(hstmt,(SQLCHAR*)sqlbuf, SQL_NTS);
    if (ret== SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) 
    {
       /* Bind columns 1, 2, and 3 */
    SQLFreeHandle(SQL_HANDLE_STMT,hstmt);
    OutputDebugString("UpdateDBCallData:succeed");
    OutputDebugString("\n");
    return true;
    }
    else
    {
    WriteSqlFile(sqlbuf);
    SQLFreeHandle(SQL_HANDLE_STMT,hstmt);
    return false;
    }
    }
    CATCH_ALL(e)
    {
    e->ReportError();
    e->Delete();
    SQLFreeHandle(SQL_HANDLE_STMT,hstmt);
    return false;
    }
    END_CATCH_ALL

    return true;
    }
      

  2.   

    try
    {}
    catch(这里要Catch com错误)
    也就是
    catch(_com_error e)
    {e.error();}
    _Com_error应该是调SQL某个COM接口错误