Vous êtes sur la page 1sur 2

ActiveConnection - A pointer to the Connection object associated with the

Command. Use Set cmmName.ActiveConnection = cnnName


for an existing open Connection. Alternatively, you can use a
valid connection string to create a new connection without
associating a named Connection object. The default value isNull.

CommandStream - A Variant read/write value that contains the input stream used
to specify the output stream.

CommandText - A String read/write value that specifies an SQL statement,


table name, stored procedure name, or an arbitrary string acceptable to the
provider of the ActiveConnection. The value
of the CommandType property determines the format of the CommandText value.
The default value is an empty string, ��.
CommandText and CommandStream are mutually exclusive. You can�t specify a
CommandStream and a CommandText value for the
same Command object.
CommandTimeout- A Long read/write value that determines the time in seconds before
terminating a Command.Execute call. This value overrides
the Connection.CommandTimeout setting. The default value is 30 seconds.

CommandType - A Long read/write value that specifies how the data provider
interprets the value of the CommandText property.
(CommandType is the equivalent of the optional lngCommandType argument of the
Connection.Execute method, described earlier in the chapter (refer to Table 30.7).
The default value is adCmdUnknown.

Dialect - A String read/write value that accepts one of four globally unique ID
(GUID) values specifying the type of
CommandStream object. Valid settings are DBGUID_DEFAULT (the provider decides
how to handle the CommandStream value),
DBGUID_SQL (an SQL statement), DBGUID_MSSQLXML (an SQLserver XML AUTO query),
and DBGUID_XPATH (an SQL Server XPath query). The values of these constants
are defined
in the �Programming Stream Objects� section near the end ofthis chapter.

Name- A String read/write value specifying the name of the


command, such as cmmNwind.

NamedParameters - A Boolean read/write value that, when set to True, specifies


that the names of members of the Parameters collection be used, rather than
their sequence, when passing parameter values
to and from SQL Server functions and stored procedures, or accepting return
or output values from stored procedures.
Prepared - A Boolean read/write value that determines whether the data source
compiles the CommandText SQL statement as a prepared statement (a temporary stored
procedure). The prepared statement
exists only for the lifetime of the Command object�s

ActiveConnection - Many client/server RDBMSs, including Microsoft SQL Server,


support prepared statements. If the data
source doesn�t support prepared statements, setting Prepared to True results
in a trappable error.

Properties - Same as the Properties collection of the Connection object.

State - A Long read/write value specifying the status of the Command.


---------------------------------------------------------------------------

com.CommandText = "[Ten Most Expensive Products]"


com.CommandType = adCmdStoredProc
Set rst = com.Execute
Do Until (rst.EOF)
Debug.Print rst.Fields("TenMostExpensiveProducts")
rst.MoveNext
Loop

Vous aimerez peut-être aussi