Product Documentation

VCL/CLX Developers Guide

Previous Topic

Next Topic

Using TCtTable with VCL Data Controls

Delphi, C++ Builder, and Kylix have a number of ready-to-use data controls. Follow this procedure to use VCL data controls:

  1. Drop a TCtSession component on the form.
  2. Logon to a c-tree session.
  3. Drop a TCtDatabase component on the form.
  4. Connect to a database.
  5. Drop a TCtTable component on the form.
  6. Open the table.
  7. Drop a DataSource component on the form. The DataSource component is found in the Data Access tab of the component palette.
  8. Set the DataSet property of the DataSource component to the desired TCtTable component.
  9. Drop data controls on the form.
  10. Set the DataSource property of the data controls to the DataSource component.
  11. Some data controls also require a DataField property setting to indicate the field of the database on which the control will operate.

The Data Controls page of the Component palette present specialized database control elements available to applications:

DBGrid

Data-aware custom grid that enables viewing and editing data in a tabular form similar to a spreadsheet. Makes extensive use of TField properties (set in the Fields editor) to determine a column's visibility, display format, ordering, and so on.

DBNavigator

Data-aware navigation buttons that move a table's current record pointer forward or backward. The navigator can also place a table in Insert, Edit, or Browse state, post new or modified records, and retrieve updated data to refresh the display.

DBText

Data-aware label that displays a field value in the current record.

DBEdit

Data-aware edit box that displays or edits a field in the current record.

DBMemo

Data-aware memo box that displays or edits BLOB text in the current record.

DBImage

Data-aware image box that displays, cuts, or pastes bitmapped BLOB images to and from the current record.

DBListBox

Data-aware list box that displays a scrolling list of values from a column in a table.

DBComboBox

Data-aware combo box that displays or edits a scrolling list of values from a column in a table.

DBCheckBox

Data-aware check box that displays or edits a Boolean data field from the current record.

DBRadioGroup

Data-aware group of radio buttons that display or set column values.

DBLookupListBox

Data-aware list box that derives its list of display items from a Lookup field defined for a dataset or a secondary data source, data field, and key. In either case, a user is presented with a restricted list of choices from which to set a valid field value. When a user selects a list item, the corresponding field value is changed in the underlying dataset. To specify list box items using a lookup field, the dataset to which the control is linked must already define a lookup field.

DBLookupComboBox

Data-aware combo box that derives its drop-down list of display items from either a lookup field defined for a dataset or a secondary data source, data field, and key. In either case, a user is presented with a restricted list of choices from which to set a valid field value. When a user selects a list item, the corresponding field value is changed in the underlying dataset. To specify combo box list items using a lookup field, the dataset to which the control is linked must already define a lookup field.

DBRichEdit

A multi-line edit control that can display and edit a rich text memo field in a dataset.

TOCIndex