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.
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
|AddParam||Adds new parameter to Command object.|
|Cancel||Cancels execution of the ExecuteQuery command.|
|DeleteParam||Deletes the specified parameter from Command object.|
|DeleteParams||Deletes all parameters from Command object.|
|Execute||Executes the command in the CommandText property.|
|AffectedRows||The number of table rows that were affected by the command.|
|CommandText||The text of the command.|
|Count||Number of parameters in current command.|
|IndexFields||A comma-separated list of index fields for a SELECT command.|
|ParamIndex||The parameter index by parameter name.|
|ParamName||The parameter name by parameter index. The index is 0-based.|
|ParamType||The data type of the specified parameter. The index is 0-based.|
|ParamValue||The parameter value.|