FirebirdSQL / fdb

Firebird Driver for Python
https://www.firebirdsql.org/en/devel-python-driver/
Other
60 stars 26 forks source link

How to connect to example.fdb by embedded server on windows? #5

Closed dauletra closed 4 years ago

dauletra commented 4 years ago

I used this guide : https://firebirdsql.org/rlsnotesh/install2-win32-embed.html

My code: con = fdb.connect(database=file_path, user='sysdba', password='masterkey', charset='utf8') fdb.fbcore.DatabaseError: ('Error while connecting to database:\n- SQLCODE: -904\n- unavailable database', -904, 335544375)

My app structure like this: c:\my_app\app.py c:\my_app\example.fdb _c:\my_app\gds32.dll c:\myapp\fbclient.dll c:\my_app\ib_util.dll c:\my_app\icudt30.dll c:\my_app\icuin30.dll c:\my_app\icuuc30.dll c:\my_app\firebird.conf c:\my_app\firebird.msg c:\my_app\intl\fbintl.dll c:\my_app\intl\fbintl.conf c:\my_app\udf\fbudf.dll

pcisar commented 4 years ago
  1. This is not a support forum.
  2. This question is not related to FDB, but Firebird.
  3. The report is badly incomplete, but here are my 2c:

Obviously, the FDB successfully connected to the Firebird server. If there was not a running Firebird, then it was clearly the embedded one. It all depends on which fbclient library was located by FDB. You can verify this using fdb.api.client_library_name attribute (available since FDB 2.0.1). However, to make sure that embedded server is used in all cases, it's recommended to use load_api() function to specify the client library used by FDB, see https://fdb.readthedocs.io/en/latest/reference.html#fdb.load_api

The Firebird server can't open the database. It could have several reasons starting from bad database file specification (you have to provide full path, not just the filename) to insufficient permissions.