Home > Net >  Try to connect a Firebird 3.05 Database to Python (pandas)
Try to connect a Firebird 3.05 Database to Python (pandas)

Time:05-16

I am trying to connect a Firebird Database with python.

I already tried it with pyodbc:

import os
import pyodbc

server = '127.0.0.1/3050' 
database = 'Databse-Name' 
username = 'Username' 
password = 'password' 
cnxn = pyodbc.connect('DRIVER={Firebird/InterBase(r) 
driver};SERVER=' server ';DATABASE=' database ';UID=' username ';PWD='  password)
cursor = cnxn.cursor()

But I get this error:

OperationalError: ('08004', "[08004] [ODBC Firebird Driver]Unable to connect to data source: library 'gds32.dll' failed to load (-904) (SQLDriverConnect); [08004] [ODBC Firebird Driver]Invalid connection string attribute (0)")

I am not sure why he tries to find 'gds32.dll'. In the ODBC-Connection I used this driver C:\Program Files (x86)\assfinet ams.5\BIN\FB30\x64\fbclient.dll

Because I am using Firebird as a 64-Bit version, so I am a bit clueless because of the 32 in 'gds32.dll'.

I am not sure, if it is the right way to try it with pyodbc. I am open for other advices.

Has anyone an idea why it is not working?

Best regards Volker

CodePudding user response:

It seems that your credentials are false. However, your database seems to be properly running.

CodePudding user response:

If you are going to use pandas with a database other than SQLite you should be using SQLAlchemy (ref: here). In your case you would use the sqlalchemy-firebird dialect.

  • Related