ColumnIndex Property

Applies to TestComplete 15.42, last modified on September 08, 2022

Description

Use the ColumnIndex property to obtain the index of a column stored in the DBTable project element that corresponds to the DBTableObj object. You can then use this index to obtain or set stored data with the Values and ValuesSelected properties.

Declaration

DBTableObj.ColumnIndex(ColumnName)

Read-Only Property Integer
DBTableObj An expression, variable or parameter that specifies a reference to a DBTable object
ColumnName [in]    Required    String    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameter:

ColumnName

Specifies the name of the desired column as it is displayed in the DBTable Element editor.

Property Value

Index of the specified column. The column index is zero-based, that is, if the column is first, its index is 0, if the column is second, its index is 1 and so on.

If the DBTable element does not contain a column with the specified name, the property returns -1.

Remarks

If you use Python or DelphiScript, you should enclose the parameter of the ColumnIndex property in square brackets: ColumnIndex[ColumnName].

Example

To view a sample script demonstrating how to use the ColumnIndex property, see the Modifying Data From Scripts section of the Modifying DBTable Elements help topic.

See Also

About Database Checkpoints
About DBTable Element Editor
Values Property
ValuesSelected Property
RowCount Property

Highlight search results