Compartir a través de


CCommand::Create

 

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 CCommand::Create.

Calls CCommand::CreateCommand to create a command for the specified session, then calls ICommandText::SetCommandText to specify the command text.

Syntax

  
      HRESULT CCommandBase::Create(  
   const CSession& session,   
   LPCWSTR wszCommand,   
   REFGUID guidCommand = DBGUID_DEFAULT  
) throw ( );  
HRESULT CCommandBase::Create(  
   const CSession& session,   
   LPCSTR szCommand,   
   REFGUID guidCommand = DBGUID_DEFAULT  
) throw ( );  

Parameters

session
[in] A session on which to create the command.

wszCommand
[in] A pointer to the Unicode text of the command string.

szCommand
[in] A pointer to the ANSI text of the command string.

guidCommand
[in] A GUID that specifies the syntax and general rules for the provider to use in parsing the command text. For a description of dialects, see ICommandText::GetCommandText in the OLE DB Programmer's Reference.

Return Value

A standard HRESULT.

Remarks

The first form of Create takes a Unicode command string. The second form of Create takes an ANSI command string (provided for backward compatibility with existing ANSI applications).

Requirements

Header: atldbcli.h

See Also

CCommand Class