Show: Delphi C++
Display Preferences

Data.Win.ADODB.TADOCommand

From RAD Studio API Documentation
Jump to: navigation, search

System.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTADOCommand

Delphi

TADOCommand = class(TComponent)

C++

class PASCALIMPLEMENTATION TADOCommand : public System::Classes::TComponent

Properties

Type Visibility Source Unit Parent
class public
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Data.Win.ADODB Data.Win.ADODB

Description

TADOCommand represents an ADO command object.

The TADOCommand represents the ADO Command object. Use TADOCommand for issuing commands against a data store accessed through an ADO (ActiveX Data Objects) provider.

The TADOCommand component executes the command specified in its CommandText property. One command may be executed at a time. Parameters, if the command includes them, are specified in its Parameters property. The command is executed by a call to the Execute method.

TADOCommand can either use a TADOConnection object to connect to a data store (through its Connection property) or connect directly to the data store if the connection information is specified in the ConnectionString property.

TADOCommand is most often used for executing data definition language (DDL) SQL commands or to execute a stored procedure that does not return a result set. For SQL statements that return a result set, TADODataSet, TADOQuery, or TADOStoredProc is better suited. The Execute method of TADOCommand is, however, capable of returning a recordset. To use that recordset, however, you will need a separate ADO dataset component.

As a close representation of the ADO Command object, many of the TADOCommand properties and methods have the same name as those of the ADO Command object and serve the same purpose. For example, the CommandType property and Execute methods are the same in both the TADOCommand component and ADO Command object. Note that subsequent versions of ADO may introduce changes in the underlying ADO command object, which will change the behavior of TADOCommand. As a result, you may want to view the Microsoft Data Store SDK documentation for additional information about the behavior of TADOCommand.

See Also

Personal tools
In Other Languages
Previous Versions
Assistance