Skip to content
Carlo Barazzetta edited this page Sep 23, 2024 · 7 revisions

The Connector component

In order for your application to use the database for object storage, you must use a connector component. The connector acts as a gateway between your application and the database (by means of an internal component called the broker) and manages all the objects that are stored to and retrieved from the database. A connector component for each type of data access layer that has been installed from InstantObjects is available on the component palette. A connector is attached to a database by assigning a connection component to its Connection (or equivalent) property. Each connector component supports its own connection type. For example:

Type Connector type Connection type
ADO TInstantADOConnector TADOConnection
BDE TInstantBDEConnector TDatabase
IBX TInstantIBXConnector TIBDatabase
DBX TInstantDBXConnector TSQLConnection
XML TInstantXMLConnector TXMLFilesAccessor
FireDAC TInstantFireDACConnector TFDConnection

InstantObjects supports a variety of databases and data-access technologies by means of packages called Brokers. You can build and install the broker(s) you need from the Brokers sub-folder of InstantObjects's Source folder.

Drop an appropriate connector component and a matching connection component on a form or a data module in your project. Configure the connection component to access the database and assign it to the Connection (or equivalent) property of the connector component. The connector will use the connection to gain access to the database. By setting the Is Default property to True, the connector will be used as the default connector in the application.

You can also use a TInstantConnectionManager component that stores connection data in external files and can create connectors and connections automatically based on this data. This is particularly useful when you don't want to hard code a particular broker or set of brokers into your program. See the Primer Demo application for an example of this technique.

Clone this wiki locally