Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
python:firebird:legacy [2022/09/05 07:04] marclebrun [Installation] |
python:firebird:legacy [2023/10/06 08:44] (Version actuelle) marclebrun |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Firebird 2.5 (Legacy) ====== | + | ====== Firebird 2.5 - Legacy "fdb" ====== |
^ Version à utiliser si le serveur Firebird est 2.5 ^ | ^ Version à utiliser si le serveur Firebird est 2.5 ^ | ||
* [[https://fdb.readthedocs.io/en/v2.0/|FDB - The Python driver for Firebird]] | * [[https://fdb.readthedocs.io/en/v2.0/|FDB - The Python driver for Firebird]] | ||
+ | * [[https://fdb.readthedocs.io/en/latest/usage-guide.html|Usage guide]] :-) | ||
===== Installation du client Firebird ===== | ===== Installation du client Firebird ===== | ||
Ligne 23: | Ligne 24: | ||
* [[https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0_x64.zip]] | * [[https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0_x64.zip]] | ||
- | Ensuite, ... (//à suivre//) | + | Ensuite, spécifier le chemin vers le fichier **.dll** lors de la connexion (voir ci-dessous). |
===== Installation du module fdb ===== | ===== Installation du module fdb ===== | ||
Ligne 38: | Ligne 39: | ||
con = fdb.connect( | con = fdb.connect( | ||
- | dsn='localhost:c:\\databases\\facturation.fdb', | + | dsn = 'localhost:c:\\databases\\facturation.fdb', |
- | user='sysdba', | + | user = 'sysdba', |
- | password='masterkey', | + | password = 'masterkey', |
- | charset='UTF8' # specify a character set for the connection | + | charset = 'UTF8' # specify a character set for the connection |
+ | ) | ||
+ | </code> | ||
+ | |||
+ | En spécifiant le chemin vers **fbclient.dll** : | ||
+ | |||
+ | <code python> | ||
+ | import sys, fdb | ||
+ | |||
+ | con = fdb.connect( | ||
+ | dsn = 'localhost:c:\\databases\\facturation.fdb', | ||
+ | user = 'sysdba', | ||
+ | password = 'masterkey', | ||
+ | charset = 'UTF8', # specify a character set for the connection | ||
+ | fb_library_name = sys.path[0] + '\\fbclient.dll' | ||
) | ) | ||
</code> | </code> |