Condividi tramite


CCommand::Create

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

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 complete 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

Reference

CCommand Class

Other Resources

CCommand Members