我是没有办法了。最好先将Format出来的结果看一看,看语法、数值是否合法。大体流程应该差不多

解决方案 »

  1.   

    1 .语法在直接跟SQL Server连的时候能够正确的插入
    2. 表是存在的没错
    3。事务在已经提交且返回正确
    4。插入的数据在直接联SQL Server已得到正确的验证
    在设置ODBC数据源有什么特别的要求?help me !
      

  2.   

    把你后执行的INSERT语句是什么样的拿出来看看。:)
      

  3.   

    format的语句在填入内容:"Insert Into t_888888_mo_bill_06 values('888888',78848,0,'','',0,1,'8613510889007',0,1,'06310',0,0,0,0,0,1,0,'','',20984405,12544,0,0,0,'','','','',0)"后直接用查询分析器插入正确。得到结果正确
    current_time=CTime::GetCurrentTime(); str_sql.Format("Insert Into t_%s_mo_bill_%02d values(\'%s\',%d,%d,\'%s\',\'%s\',%d,%d,\'%s\',%d,%d,\'%s\',%d,%d,%d,%d,%d,%d,%d,\'%s\',\'%s\',%d,%d,%d,%d,%d,\'%s\',\'%s\',\'%s\',\'%s\',%d)",
    pMsg->Bill.Account,
    current_time.GetMonth(),
    pMsg->Bill.Account,
    pMsg->Bill.MsgID1,
    pMsg->Bill.MsgID2,
    pMsg->Bill.DlvTime,
    pMsg->Bill.ServiceType, pMsg->Bill.SourceAddrTON,
    pMsg->Bill.SourceAddrNPI,
    pMsg->Bill.SourceAddr, pMsg->Bill.DestAddrTON,
    pMsg->Bill.DestAddrNPI,
    pMsg->Bill.DestinationAddr, pMsg->Bill.esm_class,
    pMsg->Bill.UDHI,
    pMsg->Bill.PID,
    pMsg->Bill.PRI,
    pMsg->Bill.RegisteredDelivery,
    pMsg->Bill.DCS,
    pMsg->Bill.SMLength,
    pMsg->Bill.SMContent,
    pMsg->Bill.CmppServiceID,
    pMsg->Bill.ServiceType,
    pMsg->Bill.ID1,
    pMsg->Bill.ID2,
    pMsg->Bill.ID3,
    pMsg->Bill.ID4,
    pMsg->Bill.MsgStatus,
    pMsg->Bill.SubmitTime,
    pMsg->Bill.DoneTime,
    pMsg->Bill.SubmitDestAddr,
    pMsg->Bill.SMSCSequence
    );
    跟这个没有关系,