Udostępnij za pośrednictwem


SET_PARAM_TYPE

Specifies COLUMN_ENTRY macros that follow the SET_PARAM_TYPE macro input, output, or input/output.

SET_PARAM_TYPE(type )

Parameters

  • type
    [in] The type to set for the parameter.

Remarks

Providers support only parameter input/output types that are supported by the underlying data source. The type is a combination of one or more DBPARAMIO values (see DBBINDING Structures in the OLE DB Programmer's Reference):

  • DBPARAMIO_NOTPARAM   The accessor has no parameters. Typically, you set eParamIO to this value in row accessors to remind the user that parameters are ignored.

  • DBPARAMIO_INPUT   An input parameter.

  • DBPARAMIO_OUTPUT   An output parameter.

  • DBPARAMIO_INPUT | DBPARAMIO_OUTPUT   The parameter is both an input and an output parameter.

Example

class CArtistsProperty
{
public:
   short m_nReturn;
   short m_nAge;
   TCHAR m_szFirstName[21];
   TCHAR m_szLastName[31];

BEGIN_PARAM_MAP(CArtistsProperty)
   SET_PARAM_TYPE(DBPARAMIO_OUTPUT)
   COLUMN_ENTRY(1, m_nReturn)
   SET_PARAM_TYPE(DBPARAMIO_INPUT)
   COLUMN_ENTRY(2, m_nAge)
END_PARAM_MAP()

BEGIN_COLUMN_MAP(CArtistsProperty)
   COLUMN_ENTRY(1, m_szFirstName)
   COLUMN_ENTRY(2, m_szLastName)
END_COLUMN_MAP()

   HRESULT OpenDataSource()
   {
      CDataSource _db;
      _db.Open();
      return m_session.Open(_db);
   }

   void CloseDataSource()
   {
      m_session.Close();
   }

   CSession m_session;

   DEFINE_COMMAND_EX(CArtistsProperty, L" \
      { ? = SELECT Age FROM Artists WHERE Age < ? }")
};

Requirements

Header: atldbcli.h

See Also

Other Resources

Macros and Global Functions for OLE DB Consumer Templates