Advantage Database Server/fr

From Free Pascal wiki
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

Une fois le descendant de TDataSet installé, vous devrez passer à l'installation du paquetage dans Lazarus.

  1. Depuis Lazarus, cliquez sur "Paquet", puis "Ouvrir un fichier de paquet (.lpk)..." et reprenez le fichier adsl.lpk dans le dossier d'installation du TDataSet (ou dans le dossier où vous avez extrait le source du TDataSet).
  2. Dans la fenêtre de paquet, cliquez sur le bouton "Compile".
  3. Lors de la compilation réussie, cliquez sur le bouton "Installer" et sélectionnez "Oui" pour reconstruire Lazarus.
  4. L'EDI Lazarus devrait compiler avec succès et redémarrer avec le composant Advantage installé.

Un projet Advantage simple

Démarrez un nouveau projet pour commencer à travailler avec des données Advantage.

* * * A FINIR * * *
  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.