Command Object
Members 
Description
Represents a database command.
Remarks

The Command object represents a database command.  You can use a Command object to query the database and return records in a Recordset Object, to execute a bulk operation, and to manipulate the structure of the database.

The Command object is intrinsically unsafe because it bypasses all the business logic of ALM and acts directly on the database. The Command object also does not validate input format. For example, you can successfully insert a value in a user-defined field of type Float although user-defined fields do not support floating values.

It is included in the API to enable the user to solve unforeseen problems. Before determining that there is no other solution to your application problem, consult your Micro Focus service representative to investigate other options.

The use of the Command object for a simple Select statement that does not change the database is safe but may affect ALM Performance.

Because of the risk, use of the Command object is restricted. For information about security and rights to use the Command object, refer to the ALM Administrator Guide.

Get a Command object from TDConnection.Command.

Example
Dim com As TDAPIOLELib.Command
Dim RecSet As TDAPIOLELib.Recordset

' Setting and executing the SQL
    Set com = tdc.Command
    com.CommandText = "select * from bug"
    Set RecSet = com.Execute


' Displaying the 2nd column data
    For i = 1 To RecSet.RecordCount
        List1.AddItem (RecSet.FieldValue(2))
        RecSet.Next
    Next
Public Methods
Public Method AddParam Adds new parameter to Command object.
Public Method Cancel Cancels execution of the ExecuteQuery command.
Public Method DeleteParam Deletes the specified parameter from Command object.
Public Method DeleteParams Deletes all parameters from Command object.
Public Method Execute Executes the command in the CommandText property.
Public Properties
Public Property AffectedRows The number of table rows that were affected by the command.
Public Property CommandText The text of the command.
Public Property Count Number of parameters in current command.
Public Property IndexFields A comma-separated list of index fields for a SELECT command.
Public Property ParamIndex The parameter index by parameter name.
Public Property ParamName The parameter name by parameter index. The index is 0-based.
Public Property ParamType The data type of the specified parameter. The index is 0-based.
Public Property ParamValue The parameter value.
See Also