2014年3月29日14:00:00
拼SQL语句执行更新
try
{
CString sInsert;
CString str;
sInsert.Format(_T("update SEXIT2013090100007 set transfermark=transfermark+8 where "));
sInsert+=_T("programstarttime='");
sInsert+=aRec.m_dtProgramStartTime.Format();
str.Format(_T("' and recordno=%d"),aRec.m_nRecordNo);
sInsert+=str;
str.Format(_T(" and exitlane=%d"),aRec.m_nExitLane);
sInsert+=str;
sInsert+=_T(" and exittime='");
sInsert+=aRec.m_dtExitTime.Format();
str.Format(_T("' and cancelrecord=%d"),aRec.m_nCancelRecord);
sInsert+=str;
pStationConnection->Execute((_bstr_t)sInsert,NULL,adCmdText);
}catch (_com_error &e)
{
CString sInfo;
sInfo.Format(_T("更新数据失败:%s"),e.ErrorMessage());
DBG_AfxMessageBox(sInfo);
exit(-1);
}