Share via


DEFINE_COMMAND

 

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 DEFINE_COMMAND.

Specifies the command that will be used to create the rowset when using the CCommand class. Accepts only string types matching the specified application type (ANSI or Unicode).

Note

It is recommended that you use DEFINE_COMMAND_EX instead of DEFINE_COMMAND.

Syntax

  
DEFINE_COMMAND(  
x  
,   
szCommand  
 )  
  

Parameters

x
[in] The name of the user record (command) class.

szCommand
[in] The command string that will be used to create the rowset when using CCommand.

Remarks

The command string that you specify will be used as the default if you do not specify command text in the CCommand::Open method.

This macro accepts ANSI strings if you build your application as ANSI, or Unicode strings if you build your application as Unicode. It is recommended that you use DEFINE_COMMAND_EX instead of DEFINE_COMMAND, because the former accepts Unicode strings, regardless of the ANSI or Unicode application type.

Example

See BOOKMARK_ENTRY.

Requirements

Header: atldbcli.h

See Also

Macros and Global Functions for OLE DB Consumer Templates