Advantage Database Server/fr

From Free Pascal wiki
Revision as of 07:50, 4 April 2017 by E-ric (talk | contribs) (→‎Linux)
Jump to navigationJump to search

English (en) français (fr)

Portail de la base de données

Références:

Tutoriels/articles pratiques :

Bases de données

Advantage - MySQL - MSSQL - Postgres - Interbase - Firebird - Oracle - ODBC - Paradox - SQLite - dBASE - MS Access - Zeos

Vue d'ensemble

Ce bref tutoriel est destiné à vous lancer dans l'utilisation du descendant de TDataSet d'Advantage pour accéder aux tables hébergées par le serveur de base de données Advantage.

Installation du TDataSet Advantage

Windows

Si vous installez le TDataSet Advantage sur Windows, vous devrez télécharger et installer les composants Advantage pour Delphi (version 10.1 ou supérieure). Les médias d'installation peuvent être obtenus sur le site Web Advantage ici.

Linux

Si vous installez Advata TDataSet sous Linux, vous devrez réaliser une installation en deux parties. Tout d'abord, téléchargez et installez le Advantage Client Engine pour Linux (version 10.1). Ensuite, téléchargez et extrayez le tarball du source TDataSet pour Linux. Les deux téléchargements sont disponibles à la Zone de développement Advantage à http://devzone.advantagedatabase.com. (Le téléchargement de Advantage Client Engine se trouve dans la section "Téléchargement de produit" du site et la source Linux TDataSet est disponible dans la section Applications de Delphi de la page CodeCentral de la Zone de développement Advantage).

Installation du paquet Advantage

Once the TDataSet Descendant is installed, you'll want to move on to installing the package into Lazarus.

  1. 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).
  2. In the package window, click the "Compile" button.
  3. Upon successful compilation, click the "Install" button, and select "Yes" to rebuild Lazarus.
  4. The Lazarus IDE should successfully compile and re-start with the Advantage components installed.

Un projet Advantage simple

Start a new project to start working with Advantage data.

  1. 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.)
  2. 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.
  3. 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.
  4. 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.)
  5. Set the AdsConnection Property for AdsTable1 to AdsConnection1 (the connection object you just dropped in step 1.)
  6. Scroll down to the "TableName" property, and use the drop-down box to select the biolife.adt table.
  7. Drop a TDataSource component on the form, and set its DataSet property to "AdsTable1".
  8. Drop a TDBGrid component on the form, and set its "DataSource" property to "Datasource1".
  9. At this point, you should be able to select the AdsTable1 object and set its "Active" property to "True".
  10. 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.