![]() |
![]() |
|||||||||||||||||||||
|
Parameters |
Contains all the Parameter objects of a Command object. |
Properties |
Contains all the Property objects for a specific instance of a Command object. This collection is not currently supported on UNIX. |
Methods
CreateParameter |
Creates a new Parameter object with the specified properties. |
Execute |
Executes the query, SQL statement, or stored procedure specified in the CommandText property. |
Properties
ActiveConnection |
The Connection object to which the specified Command object currently belongs. |
CommandText |
The text of a command that you want to issue against a provider. |
CommandTimeout |
How long to wait while executing a command before terminating the command and issuing an error. |
CommandType |
The type of Command object. |
Name |
The name of a specific Command object. This property is not currently supported on UNIX |
Prepared |
Whether or not to save a compiled version of a command before execution. This property is not currently supported on UNIX. |
State |
The current state of the Command object. This property is not currently supported on UNIX |
Remarks
A Command object is used to query a database, return records in a Recordset object, execute bulk operations, or manipulate the structure of a database. It is a definition of a specific command that you intend to execute against a data source.Note:
To execute a query without using a Command object, pass a query string to the Execute method of a Connection object or to the Open method of a Recordset object. However, a Command object is required when you want to retain the command text and re-execute it, or use query parameters.
To create a Command object independently of a previously defined Connection object, set its ActiveConnection property to a valid connection string. ADO still creates a Connection object, but it doesn't assign that object to an object variable. However, if you are associating multiple Command objects with the same connection, you should explicitly create and open a Connection object; this assigns the Connection object to an object variable. If you do not set the Command objects' ActiveConnection property to this object variable, ADO creates a new Connection object for each Command object, even if you use the same connection string.Copyright © 2000 Chili!Soft