RAD Studio |  |

Using Table Type Datasets
Advantages of using table type datasets | See Also
Collapse All
To use a table type dataset

1. Place the appropriate dataset component in a data module or on a form, and set its Name property to a unique value appropriate to your application.
2. Identify the database server that contains the table you want to use. Each table type dataset does this differently, but typically you specify a database connection component:
   - For TTable, specify a TDatabase component or a BDE alias using the DatabaseName property.
   - For TADOTable, specify a TADOConnection component using the Connection property.
   - For TSQLTable, specify a TSQLConnection component using the SQLConnection property.
   - For TIBTable, specify a TIBConnection component using the Database property. For information about using database connection components, see Connecting to databases
3. Set the TableName property to the name of the table in the database. You can select tables from a drop-down list if you have already identified a database connection component.
4. Place a data source component in the data module or on the form, and set its DataSet property to the name of the dataset. The data source component is used to pass a result set from the dataset to data-aware components for display.

Advantages of using table type datasets

The main advantage of using table type datasets is the availability of indexes. Indexes enable your application to

- Sort the Records in the Dataset.
- Locate Records Quickly.
- Limit the Records That are Visible.
- Establish Master/Detail Relationships.

In addition, the one-to-one relationship between table type datasets and database tables enables many of them to be used for

- Controlling Read/Write Access To Tables
- Creating and Deleting Tables
- Emptying Tables
- Synchronizing Tables

See Also

Using Query-type Datasets

Using Stored Procedure-type Datasets

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!