Setting up a table component
Go Up to Working with Tables
The following steps are general instructions for setting up a table component at design time. There may be additional steps you need to tailor properties of a table to the requirements of your application.
To create a table component:
- Place a table component from the InterBase page of the Tool Palette in a data module or on a form, and set its
Name
property to a unique value appropriate to your application. - Set the
Database
property to the name of the database component to access. - Set the
Transaction
property to the name of the transaction component. - Set the
DatabaseName
property in the Database component to the name of a the database containing the table. - Set the
TableName
property to the name of the table in the database. You can select tables from the drop-down list if theDatabase
andTransaction
properties are already specified, and if theDatabase
andTransaction
components are connected to the server. - Place a data source component in the data module or on the form, and set its
DataSet
property to the name of the table component. The data source component is used to pass a result set from the table to data-aware components for display.
To access the data encapsulated by a table component:
- Place a data source component from the Data Access page of the Tool Palette in the data module or form, and set its
DataSet
property to the name of the table component. - Place a data-aware control, such as
TDBGrid
, on a form, and set the control’sDataSource
property to the name of the data source component placed in the previous step. - Set the
Active
property of the table component toTrue
.
- Tip: For more information about database components, see Connecting to Databases.