请问各位高手,我的程序是console建立,suport by MFC,现在出现以下问题,请指教
这段程序在第一便循环时没出错,在第二次循环是到rs3.Open(CRecordset::snapshot,sqlstr);时出错,执行不下去了,是写法不正确吗,还是有其他的方法。谢谢,各位指点!!
for(i=0;i<fullNo;i++)//fullNo完整文件名个数
{
strcpy(tmpVolume,cutStr(szFname[i],'.',1));
strcpy(tmpSubvol,cutStr(szFname[i],'.',2));
strcpy(tmpFilename,cutStr(szFname[i],'.',3));
wsprintf(sqlstr,"select * from ENSCRIBE_FILE where ENSC_VOLUME='%s' and ENSC_SUBVOL='%s' and ENSC_FILENAME='%s' and ENSC_FLAG='1' and ENSC_REGISTER=0",tmpVolume,tmpSubvol,tmpFilename);
rs3.Open(CRecordset::snapshot,sqlstr);
if(!rs3.IsEOF( ))
{
wsprintf(sqlstr,"UPDATE ENSCRIBE_FILE set ENSC_REGISTER=1 where ENSC_VOLUME='%s' and ENSC_SUBVOL='%s' and ENSC_FILENAME='%s' and ENSC_FLAG='1' and ENSC_REGISTER=0",tmpVolume,tmpSubvol,tmpFilename);
try
{
G_db_update.ExecuteSQL(sqlstr);
}
catch(CDBException* e)
{
Write_log("执行数据库操作失败","1166",sqlstr);
e->Delete();
G_db_update.ExecuteSQL("ROLLBACK TRANSACTION");
strcpy(receive_data[index].errorMsg,"05");
return FALSE;
}
rs3.GetFieldValue("ENSC_CHANGE_MODE",varValue);
strcpy(szDmode,varValue.m_pstring[0]);
varValue.Clear();
rs3.Close();
}
}// for(i=0;i<fullNo;i++)