标题：CRecordset
CRecordset Class Members
Data Members
Construction
Recordset Attributes
Recordset Update Operations
Recordset Navigation Operations
Other Recordset Operations
Recordset Overridables
 

Data Members
m_hstmtContains the ODBC statement handle for the recordset. Type HSTMT.m_nFieldsContains the number of field data members in the recordset. Type UINT.m_nParamsContains the number of parameter data members in the recordset. Type UINT.m_pDatabaseContains a pointer to the CDatabase object through which the recordset is connected to a data source.m_strFilterContains a CString that specifies a Structured Query Language (SQL) WHERE clause. Used as a filter to select only those records that meet certain criteria.m_strSortContains a CString that specifies an SQL ORDER BY clause. Used to control how the records are sorted. 

Construction
CRecordsetConstructs a CRecordset object. Your derived class must provide a constructor that calls this one.OpenOpens the recordset by retrieving the table or performing the query that the recordset represents.CloseCloses the recordset and the ODBC HSTMT associated with it. 

Recordset Attributes
CanAppendReturns nonzero if new records can be added to the recordset via the AddNew member function.CanBookmarkReturns nonzero if the recordset supports bookmarks.CanRestartReturns nonzero if Requery can be called to run the recordset’s query again.CanScrollReturns nonzero if you can scroll through the records.CanTransactReturns nonzero if the data source supports transactions.CanUpdateReturns nonzero if the recordset can be updated (you can add, update, or delete records).GetODBCFieldCountReturns the number of fields in the recordset.GetRecordCountReturns the number of records in the recordset.GetStatusGets the status of the recordset: the index of the current record and whether a final count of the records has been obtained.GetTableNameGets the name of the table on which the recordset is based.GetSQLGets the SQL string used to select records for the recordset.IsOpenReturns nonzero if Open has been called previously.IsBOFReturns nonzero if the recordset has been positioned before the first record. There is no current record.IsEOFReturns nonzero if the recordset has been positioned after the last record. There is no current record.IsDeletedReturns nonzero if the recordset is positioned on a deleted record. 

Recordset Update Operations
AddNewPrepares for adding a new record. Call Update to complete the addition.CancelUpdateCancels any pending updates due to an AddNew or Edit operation.DeleteDeletes the current record from the recordset. You must explicitly scroll to another record after the deletion.EditPrepares for changes to the current record. Call Update to complete the edit.UpdateCompletes an AddNew or Edit operation by saving the new or edited data on the data source. 

Recordset Navigation Operations
GetBookmarkAssigns the bookmark value of a record to the parameter object.MovePositions the recordset to a specified number of records from the current record in either direction.MoveFirstPositions the current record on the first record in the recordset. Test for IsBOF first.MoveLastPositions the current record on the last record or on the last rowset. Test for IsEOF first.MoveNextPositions the current record on the next record or on the next rowset. Test for IsEOF first.MovePrevPositions the current record on the previous record or on the previous rowset. Test for IsBOF first.SetAbsolutePositionPositions the recordset on the record corresponding to the specified record number.SetBookmarkPositions the recordset on the record specified by the bookmark. 

Other Recordset Operations
CancelCancels an asynchronous operation or a process from a second thread.FlushResultSetReturns nonzero if there is another result set to be retrieved, when using a predefined query.GetFieldValueReturns the value of a field in a recordset.GetODBCFieldInfoReturns specific kinds of information about the fields in a recordset.GetRowsetSizeReturns the number of records you wish to retrieve during a single fetch.GetRowsFetchedReturns the actual number of rows retrieved during a fetch.GetRowStatusReturns the status of the row after a fetch.IsFieldDirtyReturns nonzero if the specified field in the current record has been changed.IsFieldNullReturns nonzero if the specified field in the current record is Null (has no value).IsFieldNullableReturns nonzero if the specified field in the current record can be set to Null (having no value).RefreshRowsetRefreshes the data and status of the specified row(s).RequeryRuns the recordset’s query again to refresh the selected records.SetFieldDirtyMarks the specified field in the current record as changed.SetFieldNullSets the value of the specified field in the current record to Null (having no value).SetLockingModeSets the locking mode to “optimistic” locking (the default) or “pessimistic” locking. Determines how records are locked for updates.SetParamNullSets the specified parameter to Null (having no value).SetRowsetCursorPositionPositions the cursor on the specified row within the rowset. 

Recordset Overridables
CheckCalled to examine the return code from an ODBC API function.CheckRowsetErrorCalled to handle errors generated during record fetching.DoBulkFieldExchangeCalled to exchange bulk rows of data from the data source to the recordset. Implements bulk record field exchange (Bulk RFX).DoFieldExchangeCalled to exchange data (in both directions) between the field data members of the recordset and the corresponding record on the data source. Implements record field exchange (RFX).GetDefaultConnectCalled to get the default connect string.GetDefaultSQLCalled to get the default SQL string to execute.OnSetOptionsCalled to set options for the specified ODBC statement.SetRowsetSizeSpecifies the number of records you wish to retrieve during a fetch.