The Basics > Specifying a Data Source |
True DBGrid offers unprecedented flexibility in choosing a data source. You can bind directly to Visual Basic's intrinsic Data control, OLE DB data sources such as Microsoft's ADO Data Control and Remote Data Services (RDS), or a third-party data control such as ComponentOne's True DataControl. Using True DBGrid in bound mode greatly simplifies database development by enabling you to focus on your application's interface instead of data access details.
However, there are times when binding to a data control is neither practical nor desirable, and an unbound mode of operation is necessary. By their nature, data controls add layers of overhead, which may result in performance degradation for large datasets. Bound mode is not an option if you are using a proprietary database format or one that is not supported by the standard data controls. You may even need to display a simple two-dimensional array within a grid—why bother with a database?
True DBGrid provides a sensible strategy for handling all of these situations. Regardless of which data access strategy you choose, you won't be penalized for switching to another one at a later date, as True DBGrid provides a clean separation between the data source and the grid's programmatic interface. In other words, if you write data validation or record manipulation code that works in bound mode, it will continue to work if you switch to unbound mode.
True DBGrid supports the following data access modes:
Bound |
The grid receives data and notifications from an intrinsic or external data control according to the Microsoft data binding specifications. |
Storage |
The grid receives data from a ComponentOne XArrayDB object, which can be redimensioned and populated in code much like a standard Visual Basic array. |
Application |
The grid fires data retrieval and update events for individual grid cells. |
Unbound |
The grid fires data retrieval and update events for a small set of records all at once. |