469,645 Members | 1,150 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

kinterbas and Python


Hi all,
I have some problem with packege kinterbas for Firebird db connection
this is my code:

import kinterbasdb

class ConnessioneDB:
def initialize(self):
kinterbasdb.init(concurrency_level=1)
con = kinterbasdb.connect(host='192.168.1.20',
database='/home/db/TEST.FDB', user='SYSDBA', password='masterkey) <--- E

def testtable(self):
cur = con.cursor()
cur.execute("SELECT * FROM TEST")
for row in cur:
print str(row[0])

if __name__ == '__main__':
xCon = ConnessioneDB()
xCon.initialize() <-- ERROR
xCon.testtable()

use kinterbas.init(concurrency_level=?) to set the concurrency level
legally...why ? I'm try to set this value
kinterbas.init(concurrency_level=1) but don't work...please help..this
is my first program. Thanks in advanced.Marco.Italy
--

Apr 4 '06 #1
6 1993
Balin napisał(a):
con = kinterbasdb.connect(host='192.168.1.20',
database='/home/db/TEST.FDB', user='SYSDBA', password='masterkey) <--- E


I don't think it's valid. If you connect to remote host, don't give a
path to database, just its name. Specifying full path long time ago was
supported only using "local" connection.

--
Jarek Zgoda
http://jpa.berlios.de/
Apr 4 '06 #2
Jarek, I am using it always like in the following example to connect to
the remote host and it works for me flawlessly.
Petr Jakes

import kinterbasdb as k
con = k.connect(
host='router.maren.cz',
database='/data/sysdat01.gdb',
user='SYSDBA', password='masterkey')

Apr 4 '06 #3
Petr Jakes napisał(a):
Jarek, I am using it always like in the following example to connect to
the remote host and it works for me flawlessly.
Petr Jakes

import kinterbasdb as k
con = k.connect(
host='router.maren.cz',
database='/data/sysdat01.gdb',
user='SYSDBA', password='masterkey')


Sorry for confusion. Didn't expect that FB moved so far from Interbase.

--
Jarek Zgoda
http://jpa.berlios.de/
Apr 5 '06 #4
Balin wrote:
Hi all,
I have some problem with packege kinterbas for Firebird db connection
this is my code:

import kinterbasdb

class ConnessioneDB:
def initialize(self):
kinterbasdb.init(concurrency_level=1)
con = kinterbasdb.connect(host='192.168.1.20',
database='/home/db/TEST.FDB', user='SYSDBA', password='masterkey) <--- E


If that's the actual code you're using, presumably you're getting an
error message like:
SyntaxError: EOL while scanning single-quoted string
because there's no closing quote after 'masterkey.

If that's not the actual code, could you post the actual code, the
actual error message, along with the versions of Python, Firebird,
KInterbasDB, and your operating system?

Apr 6 '06 #5
Ok, thank..my python is 2.4.2
kinterbas is 3.2a1
Firebird is 1.5 on FEDORA CORE 4
my program code is run under winxp.... my actual code is equal above
and
when i past the code i forgot the quote but in my code the quote is
correctly.
My error code is :

concorrency level error
use kinterbas.init(concurrency_level=?) to set the concurrency level
legally...

thanks in advanced.

Apr 6 '06 #6
bs****@tin.it wrote:
My error code is :

concorrency level error
use kinterbas.init(concurrency_level=?) to set the concurrency level
legally...


That's not the actual error message. The actual error message is:
"""
The concurrency level cannot be changed once it has been set. Use
kinterbasdb.init(concurrency_level=?) to set the concurrency level
legally.
"""

So, it seems that you're either trying to call kinterbasdb.init
multiple times, or you're performing an operation that calls
kinterbasdb.init implicitly, and later you're trying to call
kinterbasdb.init explicitly.

Either remove the kinterbasdb.init call entirely, or move it to a place
where it is called before you perform any database operations, and
won't be called again.

Apr 8 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.