strSql = "UPDATE XT_JOB SET JOB_STATUS = 12,LEFT_NUMBER = " + strDataNum[1]
+ ",GOOD_NUMBER = " + cGoodCount + ",BAD_NUMBER = " + strDataNum[3]
+ ",PRODUCT_NUMBER = " + strDataNum[5] + ",REDO_NUMBER = " + strDataNum[4]
+ ",DROP_NUMBER =" + strDataNum[6] + ",UPDATE_TIME = TO_DATE('" + strDate + "','YYYY-MM-DD HH24:MI:SS') WHERE JOB_ID = " + CString(cJobID);
iRetVal = WriteDataFile(hDataFile,DBSQL_LEVEL,cModuleName,0,strSql.GetBuffer(strSql.GetLength()),cErrTxt);
strSql.ReleaseBuffer();
mServerConn->Execute(strSql.AllocSysString(), NULL, adExecuteNoRecords);
SysFreeString(strSql.AllocSysString());
时间的获取
strDate = "";
GetLocalTime(&st);
strDate.Format("%4d-%2d-%2d %2d:%2d:%2d",st.wYear,st.wMonth,st.wDay,st.wHour,st.wMinute,st.wSecond);
------解决方案--------------------------------------------------------
WHERE JOB_ID = " + CString(cJobID);
改为
WHERE JOB_ID = '" + CString(cJobID) + "'";