Skip to content

Instantly share code, notes, and snippets.

@mariuz
Created November 14, 2011 15:23
Show Gist options
  • Save mariuz/1364162 to your computer and use it in GitHub Desktop.
Save mariuz/1364162 to your computer and use it in GitHub Desktop.
Example 3 for pyfirebirdsql
import firebirdsql as fb
name = 0
TABLE_NAME = 'languages'
SELECT = 'select * from %s order by year_released' % TABLE_NAME
con = fb.connect(dsn='localhost:/tmp/test.fdb', user='sysdba', password='masterkey')
cur = con.cursor()
cur.execute(SELECT)
# Print a header.
for fieldDesc in cur.description:
print fieldDesc[name] ,
print # Finish the header with a newline.
print '-' * 78
# For each row, print the value of each field left-justified within
# the maximum possible width of that field.
fieldIndices = range(len(cur.description))
for row in cur:
for fieldIndex in fieldIndices:
fieldValue = str(row[fieldIndex])
print fieldValue ,
print # Finish the row with a newline.
@jtraslavi
Copy link

I installed this driver with all versions of Python from 3.0 and always shows me the same error, the trace is this....

Traceback (most recent call last):
File "H:\proypy\prueba\test.py", line 13, in wire_crypt=True)
File "H:\python33\lib\site-packages\firebirdsql__init__.py", line 62, in connect return Connection(**kwargs)
File "H:\python33\lib\site-packages\firebirdsql\fbcore.py", line 580, in init self._op_attach()

File "H:\python33\lib\site-packages\firebirdsql\wireprotocol.py", line 523, in _op_attach
s = self.str_to_bytes(crypt.crypt(self.password, '9z')[2:])
AttributeError: 'NoneType' object has no attribute 'crypt'

I use Win XP SP3
Python 3.3
Firebird 2.5
pyfirebirdsql 0.9.2

Can you tell me what could be the error? I've tried everything and it did not work .. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment