473,498 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2116
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1753
by: Uwe Grauer | last post by:
Hi, i need to know the database column types returned by kinterbasdb. Implicit type conversion is i nice thing to have, but it hides the real types in the database. So how could i get this...
1
2370
by: Emile van Sebille | last post by:
QOTW: "If we get 2.3.3c1 out in early December, we could release 2.3.3 final before the end of the year, and start 2004 with a 100% bug-free codebase <wink>." -- Tim Peters "cjOr proWe vbCould...
0
1869
by: Emile van Sebille | last post by:
QOTW: "Have you ever used the copy module? I am *not* a beginner, and have used it *once* (and I can't remember what for, either)." -- Michael Hudson "It will likely take a little practice...
1
1261
by: jim | last post by:
hi- is anyone using this combo of tools? do you have a website i can visit or gui with screen shots or fairly easy to install so i can get inspired? now that firebird has its first manual and...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.