共用方式為


CRecordset::m_nParams

Contains the number of parameter data members in the recordset class; that is, the number of parameters passed with the recordset's query.

Remarks

If your recordset class has any parameter data members, the constructor for the class must initialize m_nParams with the correct number. The value of m_nParams defaults to 0. If you add parameter data members (which you must do manually) you must also manually add an initialization in the class constructor to reflect the number of parameters (which must be at least as large as the number of '?' placeholders in your m_strFilter or m_strSort string).

The framework uses this number when it parameterizes the recordset's query.

警告

This number must correspond to the number of "params" registered in DoFieldExchange or DoBulkFieldExchange after a call to SetFieldType with a parameter value of CFieldExchange::inputParam, CFieldExchange::param, CFieldExchange::outputParam, or CFieldExchange::inoutParam.

Example

See the articles Recordset: Parameterizing a Recordset (ODBC) and Record Field Exchange: Using RFX.

Requirements

Header: afxdb.h

See Also

Reference

CRecordset Class

Hierarchy Chart

CRecordset::DoFieldExchange

CRecordset::DoBulkFieldExchange

CRecordset::m_nFields

CFieldExchange::SetFieldType

Other Resources

CRecordset Members