22,300
社区成员




_RecordsetPtr rs;
...
...
try()
{
rs->Open(sqlstring,
_variant_t((IDispatch*)pApp->m_pConnection),
ADODB::adOpenStatic,ADODB::adLockOptimistic,ADODB::adCmdText);
rs->Fields->Item["UserId"]->Value = (_variant_t)m_newedit;
rs->Update();
}
catch(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
CString sError;
sError.Format( "Source : %s \n Description : %s\n",
(LPCSTR)bstrSource,(LPCSTR)bstrDescription);
AfxMessageBox(sError);
}
_ConnectionPtr rs_conn;
_RecordsetPtr rs;
...
...
try()
{
rs=rs_conn->Execute(_bstr_t(sqlstring),0,0);
rs->Fields->Item["UserId"]->Value = (_variant_t)m_newedit;
rs->Update();
}
catch(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
CString sError;
sError.Format( "Source : %s \n Description : %s\n",
(LPCSTR)bstrSource,(LPCSTR)bstrDescription);
AfxMessageBox(sError);
}
rs->Fields->Item["UserImage"]->AppendChunk(pvList);
--EXECUTE相当于查询出来的结果集,并不是表,不能直接修改!