Skip to content

Latest commit

 

History

History
111 lines (92 loc) · 2.49 KB

File metadata and controls

111 lines (92 loc) · 2.49 KB
title SET_PARAM_TYPE | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic article
f1_keywords
SET_PARAM_TYPE
dev_langs
C++
helpviewer_keywords
SET_PARAM_TYPE macro
ms.assetid 85979070-2d55-4c67-94b1-9b9058babc59
caps.latest.revision 9
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
ru-ru
zh-cn
zh-tw
translation.priority.mt
cs-cz
pl-pl
pt-br
tr-tr

SET_PARAM_TYPE

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

Syntax

  
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

Macros and Global Functions for OLE DB Consumer Templates