CRecordset::m_nParams

Remarks

Contains the number of parameter data members in the recordset class — the number of parameters passed with the recordset’s query. 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.

Important   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 in Visual C++ Programmer’s Guide.

CRecordset OverviewClass MembersHierarchy Chart

See Also   CRecordset::DoFieldExchange, CRecordset::DoBulkFieldExchange, CRecordset::m_nFields, CFieldExchange::SetFieldType