access 施用到了m_pRs->movePrevious(),总出错

access 使用到了m_pRs->movePrevious(),总出错
本来应该指到上一行,却总是报错,怎么解决,MFC ,access数据库,id自动编号
------解决方案--------------------
if(!m_pRs->IsBof())//没有到记录头
{
m_pRs->movePrevious();
}
------解决方案--------------------
有可能是你的记录集在创建的时候,不支持查找上一条的操作。
在创建记录集时,不同类型的记录集支持的操作是不一样的。
------解决方案--------------------
CRecordset::Open  

Opens the recordset by retrieving the table or performing the query that the recordset represents.

virtual BOOL Open( 
   UINT nOpenType = AFX_DB_USE_DEFAULT_TYPE, 
   LPCTSTR lpszSQL = NULL, 
   DWORD dwOptions = none  
);
 


Parameters
nOpenType
Accept the default value, AFX_DB_USE_DEFAULT_TYPE, or use one of the following values from the enum OpenType:

CRecordset::dynaset   A recordset with bi-directional scrolling. The membership and ordering of the records are determined when the recordset is opened, but changes made by other users to the data values are visible following a fetch operation. Dynasets are also known as keyset-driven recordsets.

CRecordset::snapshot   A static recordset with bi-directional scrolling. The membership and ordering of the records are determined when the recordset is opened; the data values are determined when the records are fetched. Changes made by other users are not visible until the recordset is closed and then reopened.

CRecordset::dynamic   A recordset with bi-directional scrolling. Changes made by other users to the membership, ordering, and data values are visible following a fetch operation. Note that many ODBC drivers do not support this type of recordset.

CRecordset::forwardOnly   A read-only recordset with only forward scrolling. 

For CRecordset, the default value is CRecordset::snapshot. The default-value mechanism allows the Visual C++ wizards to interact with both ODBC CRecordset and DAO CDaoRecordset, which have different defaults. 

For more information about these recordset types, see the article Recordset (ODBC). For related information, see the article "Using Block and Scrollable Cursors" in the Platform SDK. 

Caution  
If the requested type is not supported, the framework throws an exception.

这是MSDN上的解释,可以参考一下