else if(pSheet->m_bUpdate)
{
CString strSQL;
strSQL.Format("SELECT * FROM Component WHERE MID = '%s'"m_strCurModel);
//TESTHR is a Marco defined to "try...catch" mechanism
TESTHR(pSheet->m_General.m_adoRecordGeneral.Open(strSQL));
int n = pSheet->m_General.m_adoRecordGeneral.GetRecordCount();
CString strdd;
pSheet->m_General.m_adoRecordGeneral.GetCollect(1, strdd); try
{
//put the description into the database
BOOL b = pSheet->m_General.m_adoRecordGeneral.PutCollect(_T("Description"), pSheet->m_General.m_strDescription );
//update the recordset
b = pSheet->m_General.m_adoRecordGeneral.Update();
pSheet->m_General.m_adoRecordGeneral.Requery();
}
我的目的是在Update时,改变Description字段的值,结果跟踪发现调用PutCollect时是对的(b == 1),但是Update时是错误的(b==0),不知道可能是错在那里,大侠们能帮忙看看吗?谢谢!
{
CString strSQL;
strSQL.Format("SELECT * FROM Component WHERE MID = '%s'"m_strCurModel);
//TESTHR is a Marco defined to "try...catch" mechanism
TESTHR(pSheet->m_General.m_adoRecordGeneral.Open(strSQL));
int n = pSheet->m_General.m_adoRecordGeneral.GetRecordCount();
CString strdd;
pSheet->m_General.m_adoRecordGeneral.GetCollect(1, strdd); try
{
//put the description into the database
BOOL b = pSheet->m_General.m_adoRecordGeneral.PutCollect(_T("Description"), pSheet->m_General.m_strDescription );
//update the recordset
b = pSheet->m_General.m_adoRecordGeneral.Update();
pSheet->m_General.m_adoRecordGeneral.Requery();
}
我的目的是在Update时,改变Description字段的值,结果跟踪发现调用PutCollect时是对的(b == 1),但是Update时是错误的(b==0),不知道可能是错在那里,大侠们能帮忙看看吗?谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货