We recommend using Visual Studio 2017

CDaoParameterInfo Structure


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CDaoParameterInfo Structure.

The CDaoParameterInfo structure contains information about a parameter object defined for data access objects (DAO).

struct CDaoParameterInfo  
    CString m_strName;       // Primary  
    short m_nType;           // Primary  
    ColeVariant m_varValue;  // Secondary  


Uniquely names the parameter object. For more information, see the topic "Name Property" in DAO Help.

A value that indicates the data type of a parameter object. For a list of the possible values, see the m_nType member of the CDaoFieldInfo structure. For more information, see the topic "Type Property" in DAO Help.

The value of the parameter, stored in a COleVariant object.

The references to Primary and Secondary above indicate how the information is returned by the GetParameterInfo member function in class CDaoQueryDef.

MFC does not encapsulate DAO parameter objects in a class. DAO querydef objects underlying MFC CDaoQueryDef objects store parameters in their Parameters collections. To access the parameter objects in a CDaoQueryDef object, call the querydef object's GetParameterInfo member function for a particular parameter name or an index into the Parameters collection. You can use the CDaoQueryDef::GetParameterCount member function in conjunction with GetParameterInfo to loop through the Parameters collection.

Information retrieved by the CDaoQueryDef::GetParameterInfo member function is stored in a CDaoParameterInfo structure. Call GetParameterInfo for the querydef object in whose Parameters collection the parameter object is stored.

System_CAPS_ICON_note.jpg Note

If you want to get or set only the value of a parameter, use the GetParamValue and SetParamValue member functions of class CDaoRecordset.

CDaoParameterInfo also defines a Dump member function in debug builds. You can use Dump to dump the contents of a CDaoParameterInfo object.

Header: afxdao.h

Structures, Styles, Callbacks, and Message Maps
CDaoQueryDef Class