我也遇到了
strSQL.Format("Update Material Set Material.MaterialID='s',Material.Name='s',Material.SumNumber=s,Material.Inventory=s,\
Material.Locate='%s',Material.Type='%s',Material.Press='%s',Material.Author='%s',\
Material.Price='%s',Material.StorageTime=#%s# where Material.MaterialID='%s",\
m_ID,m_name,m_sunNum,m_inventory,m_location,m_type,m_press,m_author,m_price,\
strDateTime,m_ID);语句好像是对的
m_adoConDel.ExecuteSQL((_bstr_t)strSQL);//此处有问题
_RecordsetPtr rst1;
CString sql="slect * from fifnum where ";
CString sql1,sql2,sql3,sql4;
rst1=rst;
int count;
sql1.Format("i0=%d and i1=%d and i2=%d and i3=%d and ",board[0][0],board[0][1],board[0][2],board[0][3]);
sql2.Format("i4=%d and i5=%d and i6=%d and i7=%d and ",board[1][0],board[1][1],board[1][2],board[1][3]);
sql3.Format("i8=%d and i9=%d and i10=%d and i11=%d and ",board[2][0],board[2][1],board[2][2],board[2][3]);
sql4.Format("i12=%d and i13=%d and i14=%d and i15=%d ",board[3][0],board[3][1],board[3][2],board[3][3]);
sql+=sql1;
sql+=sql2;
sql+=sql3;
sql+=sql4;
try
{
rst->raw_Close();
rst->Open((_bstr_t)sql,conn.GetInterfacePtr(),adOpenDynamic, adLockPessimistic,adCmdText);
count=rst->GetRecordCount();
rst->Close();
rst->Open("select * from fifnum",conn.GetInterfacePtr(),adOpenStatic,adLockOptimistic,adCmdText);//打开就记录集
if(count>0)
return true;
else
return false;
}
catch(_com_error &e)
{
AfxMessageBox(e.ErrorMessage(),0,0);
}
}
_RecordsetPtr rst1;
CString sql="slect * from fifnum where ";
CString sql1,sql2,sql3,sql4;
rst1=rst;
int count;
sql1.Format("i0=%d and i1=%d and i2=%d and i3=%d and ",board[0][0],board[0][1],board[0][2],board[0][3]);
sql2.Format("i4=%d and i5=%d and i6=%d and i7=%d and ",board[1][0],board[1][1],board[1][2],board[1][3]);
sql3.Format("i8=%d and i9=%d and i10=%d and i11=%d and ",board[2][0],board[2][1],board[2][2],board[2][3]);
sql4.Format("i12=%d and i13=%d and i14=%d and i15=%d ",board[3][0],board[3][1],board[3][2],board[3][3]);
sql+=sql1;
sql+=sql2;
sql+=sql3;
sql+=sql4;
try
{
rst->raw_Close();
rst->Open((_bstr_t)sql,conn.GetInterfacePtr(),adOpenDynamic, adLockPessimistic,adCmdText);
count=rst->GetRecordCount();
rst->Close();
rst->Open("select * from fifnum",conn.GetInterfacePtr(),adOpenStatic,adLockOptimistic,adCmdText);//打开就记录集
if(count>0)
return true;
else
return false;
}
catch(_com_error &e)
{