ADO Command
Object
Command Object
The ADO Command object is used to execute a simple query against a database. This query can perform actions such as creating, adding, retrieving, deleting, or updating records.
If the query is used to retrieve data, the data will be returned as a RecordSet object. This means that the retrieved data can be manipulated using the properties, collections, methods, or events of the RecordSet object.
The main feature of the Command object is its ability to use stored queries and stored procedures with parameters.
ProgID
Properties
Property | Description |
---|---|
ActiveConnection | Sets or returns a string that contains a defined connection or Connection object. |
CommandText | Sets or returns a string value that contains a provider command, such as an SQL statement, table name, or stored procedure call. The default value is "" (a zero-length string). |
CommandTimeout | Sets or returns a long integer value that indicates the wait time before terminating the command execution (in seconds). The default value is 30. |
CommandType | Sets or returns the type of a Command object. |
Name | Sets or returns the name of a Command object. |
Prepared | Indicates whether to save a compiled version (prepared version) of the command before execution. |
State | Returns a value that describes whether the Command object is in an open, closed, connected, executing, or retrieving data state. |
Methods
Method | Description |
---|---|
Cancel | Cancels the execution of a method. |
CreateParameter | Creates a new Parameter object. |
Execute | Executes the query, SQL statement, or stored procedure in the CommandText property. |
Collections
Collection | Description |
---|---|
Parameters | Contains all Parameter objects of a Command object. |
Properties | Contains all Property objects of a Command object. |