本人在开发一个基于OLD DB的VC数据库程序时,在更改某条记录时遇到一个问题: 
(环境为vc 6.0,SQL 7.0,MFC,在形成记录集时采用了Insert ->new ATL object)
class CPoscfgSetAccessor
{
public:
LONG m_posno;
LONG m_posmachine;BEGIN_COLUMN_MAP(CPoscfgSetAccessor)
COLUMN_ENTRY(1, m_posno)
COLUMN_ENTRY(2, m_posmachine)
END_COLUMN_MAP()DEFINE_COMMAND(CPoscfgSetAccessor, _T(" \
SELECT \
pos_no, \
pos_machine \
FROM dbo.Poscfg")) void ClearRecord()
{
memset(this, 0, sizeof(*this));
}
};class CPoscfgSet : public CCommand<CAccessor<CPoscfgSetAccessor> >
{
public:

HRESULT Open()
{
HRESULT hr; hr = OpenDataSource();
if (FAILED(hr))
return hr; return OpenRowset();
}
HRESULT OpenDataSource()
{
HRESULT hr;
CDataSource db;
CDBPropSet dbinit(DBPROPSET_DBINIT); dbinit.AddProperty(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, false);
dbinit.AddProperty(DBPROP_AUTH_USERID, struid);
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, strpwd);
dbinit.AddProperty(DBPROP_INIT_CATALOG, strdb);
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, strserver);
dbinit.AddProperty(DBPROP_INIT_LCID, (long)2052);
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4);
dbinit.AddProperty(DBPROP_INIT_TIMEOUT, (long)5);
hr = db.Open(_T("SQLOLEDB.1"), &dbinit);
if (FAILED(hr))
return hr; return m_session.Open(db);
}
HRESULT OpenRowset()
{
// Set properties for open
CDBPropSet propset(DBPROPSET_ROWSET);
propset.AddProperty(DBPROP_IRowsetChange, true);
propset.AddProperty(DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE);
char strsql[4096];
char *SQLCommand;
GetDefaultCommand((const char **)&SQLCommand);
strcpy(strsql,SQLCommand);
if(!m_strFilter.IsEmpty())
{
strcat(strsql," WHERE ");
strcat(strsql,m_strFilter);
}
return CCommand<CAccessor<CPoscfgSetAccessor> >::Open(m_session, strsql, &propset);
}
CString     m_strFilter;
CSession m_session;
};
CPoscfgSet cfgset; 
HRESULT hr; 
cfgset.ClearRecord();
hr=cfgset.Open();
if(hr!=S_OK)
{
InformationBox("错误","无此POS终端号!",0);
return 0;
}
hr=cfgset.MoveFirst();
if(hr!=S_OK)
{
InformationBox("错误","查询POS参数表出错!",0);
return 0;
}
cfgset.m_posmachine=POS_CFGOK.pos_machine;hr=cfgset.SetData(); 
if(hr!=S_OK) 

  return 0; 

cfgset.Close();程序编译连接都成功,也能运行,但就是不能更改某条记录的值,即运行到hr=cfgset.SetData()不成功(总是返回0),请问不知问题出在哪?