CDSRecordset rst;
rst.SetDatabase(&theApp.m_dbComm);
strSQL.Format("SELECT * FROM TEMP_001_DATA");
try
{
rst.Open(CDSRecordset::snapshot,strSQL,CDSRecordset::readOnly);
while (!rst.IsEOF())
{
rst.GetFieldValue(_T("SERIAL_NO"),TempData.m_strSERIAL_NO);
rst.GetFieldValue(_T("BUSINESS_ID"),TempData.m_strBUSINESS_ID);
rst.GetFieldValue(_T("SUB_ID"),TempData.m_strSUB_ID);
rst.GetFieldValue(_T("BATCH_ID"),TempData.m_strBATCH_ID);
rst.GetFieldValue(_T("INC_CODE"),TempData.m_strINC_CODE);
rst.GetFieldValue(_T("UNIT_NO"),TempData.m_strUNIT_NO);
rst.GetFieldValue(_T("UNIT_INC_CODE"),TempData.m_strUNIT_INC_CODE);
rst.GetFieldValue(_T("BAR_CODE"),TempData.m_strBAR_CODE);
rst.GetFieldValue(_T("IMG_OFFSET"),TempData.m_strIMG_OFFSET);
rst.GetFieldValue(_T("IMG_LENGTH"),TempData.m_strIMG_LENGTH);
rst.GetFieldValue(_T("SELF_DELETE"),TempData.m_strSELF_DELETE);
rst.GetFieldValue(_T("FORM_TYPE"),TempData.m_strFORM_TYPE);
rst.GetFieldValue(_T("PAGE_COUNT"),TempData.m_strPAGE_COUNT);
rst.GetFieldValue(_T("PROCESS_STATE"),TempData.m_strPROCESS_STATE);
rst.GetFieldValue(_T("IS_FRONT_PAGE"),TempData.m_strIS_FRONT_PAGE);
rst.GetFieldValue(_T("BAR_FAIL_CAUSE"),TempData.m_strBAR_FAIL_CAUSE);
rst.GetFieldValue(_T("FORM_FAIL_CAUSE"),TempData.m_strFORM_FAIL_CAUSE);
rst.GetFieldValue(_T("OCR_FAIL_CAUSE"),TempData.m_strOCR_FAIL_CAUSE);
rst.GetFieldValue(_T("CHECK_WORKER"),TempData.m_strCHECK_WORKER);
rst.GetFieldValue(_T("PRIMARY_WORKER"),TempData.m_strPRIMARY_WORKER);
rst.GetFieldValue(_T("OCR_WORKER"),TempData.m_strOCR_WORKER);
rst.GetFieldValue(_T("OCR_PRE_WORKER"),TempData.m_strOCR_PRE_WORKER);
rst.GetFieldValue(_T("BAR_WORKER"),TempData.m_strBAR_WORKER);
rst.GetFieldValue(_T("INPUT_BYTES"),TempData.m_strINPUT_BYTES);
rst.GetFieldValue(_T("NSRSBH"),TempData.m_strNSRSBH);
rst.GetFieldValue(_T("SITE_NO"),TempData.m_strSITE_NO);
rst.GetFieldValue(_T("LSEQ_ID"),TempData.m_strLSEQ_ID);
rst.GetFieldValue(_T("INDEX_FIELD"),TempData.m_strINDEX_FIELD);
rst.GetFieldValue(_T("CHECK_FLAG"),TempData.m_strCHECK_FLAG);
rst.GetFieldValue(_T("CD_PATH"),TempData.m_strCD_PATH);
rst.GetFieldValue(_T("CD_VOLUME_ID"),TempData.m_strCD_VOLUME_ID);
rst.GetFieldValue(_T("SUBMIT_DATE"),TempData.m_strSUBMIT_DATE);
rst.GetFieldValue(_T("RECV_TIME"),TempData.m_strRECV_TIME);
rst.GetFieldValue(_T("RECV_USER"),TempData.m_strRECV_USER);
rst.GetFieldValue(_T("HAVE_HISTORY_VERSION"),TempData.m_strHAVE_HISTORY_VERSION);
CString strSql,strBusiness_id;
strSql.Format(_T("SELECT BUSINESS_ID FROM BUSINESS_SUB_TYPE"));
CDSRecordset Rect;
Rect.SetDatabase(&theApp.m_dbComm);
try
{
rst.Open(CDSRecordset::snapshot);
while(!rst.IsBOF())
{
Rect.GetFieldValue(_T("BUSINESS_ID"),strBusiness_id);
strBusiness_id.TrimLeft(",");
strBusiness_id.TrimRight(",");
strBusiness_id = m_strBusiness_id;
rst.MoveNext();
}
}
catch (CException* e)
{
static char m_strError[1024];
e->GetErrorMessage(m_strError,1024);
e->ReportError();
e->Delete();
return FALSE;
}
CString HIS_;
CString STR = HIS_ + m_strBusiness_id;
theApp.m_dbComm.ExecuteSQL(_T("INSERT INTO %s(IMAGE_ID,BUSINESS_ID,SUB_ID,BATCH_ID,INC_CODE,UNIT_NO,UNIT_INC_CODE,BAR_CODE,IMG_OFFSET,MG_LENGTH,\
SELF_DELETE,FORM_TYPE,PAGE_COUNT,PROCESS_STATE,IS_FRONT_PAGE,BAR_FAIL_CAUSE,FORM_FAIL_CAUSE,OCR_FAIL_CAUSE,CHECK_WORKER,PRIMARY_WORKER,\
OCR_WORKER,OCR_PRE_WORKER,BAR_WORKER,INPUT_BYTES,NSRSBH,SITE_NO,LSEQ_ID,INDEX_FIELD,CHECK_FLAG,CD_PATH,\
CD_VOLUME_ID,SUBMIT_DATE,RECV_TIME,RECV_USER,HAVE_HISTORY_VERSION) VALUES(TempData.m_strSERIAL_NO,TempData.m_strBUSINESS_ID,TempData.m_strSUB_ID,TempData.m_strBATCH_ID,TempData.m_strINC_CODE,\
TempData.m_strUNIT_NO,TempData.m_strUNIT_INC_CODE,TempData.m_strBAR_CODE,TempData.m_strIMG_OFFSET,TempData.m_strIMG_LENGTH,\
TempData.m_strSELF_DELETE,TempData.m_strFORM_TYPE,TempData.m_strPAGE_COUNT,TempData.m_strPROCESS_STATE,TempData.m_strIS_FRONT_PAGE,\
TempData.m_strBAR_FAIL_CAUSE,TempData.m_strFORM_FAIL_CAUSE,TempData.m_strOCR_FAIL_CAUSE,TempData.m_strCHECK_WORKER,TempData.m_strPRIMARY_WORKER,\
TempData.m_strOCR_WORKER,TempData.m_strOCR_PRE_WORKER,TempData.m_strBAR_WORKER,TempData.m_strINPUT_BYTES,TempData.m_strNSRSBH,\
TempData.m_strSITE_NO,TempData.m_strLSEQ_ID,TempData.m_strINDEX_FIELD,TempData.m_strCHECK_FLAG,TempData.m_strCD_PATH,\
TempData.m_strCD_VOLUME_ID,TempData.m_strSUBMIT_DATE,TempData.m_strRECV_TIME,TempData.m_strRECV_USER,TempData.m_strHAVE_HISTORY_VERSION)",STR));
}
}
catch(CException* e)
{
static char m_strError[1024];
e->GetErrorMessage(m_strError,1024);
e->ReportError();
e->Delete();
return FALSE;
}
6 个解决方案
#1
好长,楼主检查下代码
#2
什么问题?
#3
好像没说明下 是说明问题啊?
#5
干嘛?
#6
原来是教学帖
#1
好长,楼主检查下代码
#2
什么问题?
#3
好像没说明下 是说明问题啊?
#4
#5
干嘛?
#6
原来是教学帖