Advantage Database Server
English (en) │
français (fr) │
This brief tutorial is intended to get you started using the Advantage TDataSet descendent to access tables hosted by the Advantage Database Server.
Installing the Advantage TDataSet
If installing the Advantage TDataSet on Windows, you will need to download and install the Advantage Delphi Components (version 10.1 or greater). The install media can be obtained from the Advantage web site here.
If installing the Advantage TDataSet on Linux, you will need to complete a two-part installation. First, download and install the Advantage Client Engine for Linux (version 10.1). Second, download and extract the Linux TDataSet source tarball. Both downloads are available at the Advantage Developer Zone at http://devzone.advantagedatabase.com. (The Advantage Client Engine download is located in the "Product Download" section of the site, and the Linux TDataSet source is available in the Delphi Applications section of the CodeCentral page of the Advantage Developer Zone.)
Installing the Advantage Package
Once the TDataSet Descendant is installed, you'll want to move on to installing the package into Lazarus.
- From Lazarus, click on "Package", then "Open Package File (.lpk)..." and browse to the adsl.lpk file in the TDataSet installation directory (or in the directory you extracted the TDataSet source).
- In the package window, click the "Compile" button.
- Upon successful compilation, click the "Install" button, and select "Yes" to rebuild Lazarus.
- The Lazarus IDE should successfully compile and re-start with the Advantage components installed.
A simple Advantage project
Start a new project to start working with Advantage data.
- Drop a TAdsConnection object from the Advantage tab of the palette onto your form. (The TAdsConnection object is the left-most object on the Advantage tab.)
- In the Object Inspector, click the drop-down for the AliasName property, and select "ADTDemoData".
- Alternately, you can select the ConnectPath property and enter (or browse to) the path to the Help\ADS_Data directory beneath your TDataSet (or acesdk on Linux) install directory.
- Expand the AdsServerTypes property, and change the "stADS_LOCAL" property to True.
- If you have an Advantage Database server configured and running, you may set "stADS_REMOTE" to true instead.
- Drop a TAdsTable object on the form. (The TAdsTable object is immediately to the right of the TAdsConnection object on the tab, and it looks like a red table.)
- Set the AdsConnection Property for AdsTable1 to AdsConnection1 (the connection object you just dropped in step 1.)
- Scroll down to the "TableName" property, and use the drop-down box to select the biolife.adt table.
- Drop a TDataSource component on the form, and set its DataSet property to "AdsTable1".
- Drop a TDBGrid component on the form, and set its "DataSource" property to "Datasource1".
- At this point, you should be able to select the AdsTable1 object and set its "Active" property to "True".
- Finally, run the project. (Note that you may need to save the project before running it.)
Since the Advantage components descend from the TDataSet, you can use these components with any data-aware component that supports the TDataSet. This extremely simple example should demonstrate how simple it is to get started with Advantage.