[DB-SIG] kinterbasdb Strange problem.. PLS HELP...

Vivek Kumar vivsar_guve at yahoo.co.uk
Wed May 21 02:50:10 EDT 2003


Hi all,
  I am trying to use Firebird Database Server for
creating a Book Store (shopping cart typo).But I am
facing a very strange error. 

The error is like this..

I have created a script called dbInterface.py in which
I have a function connect

def connect():
    try:       
con=kinterbasdb.connect(dsn="C:/data/SHOP.FDB",user="shop_cart",password="shop_cart")
    except Exception,err:
        writeError("Error : %s" %str(err)) #this
function writes the error to a log
        return None
    else:
        return con

and one more function which creates a new buyer id for
the visiting user.createNewBuyer...

def createNewBuyer():
    con=connect()
    if con is None:
        return -1
    else:
        try:
            cur=con.cursor()
            cur.execute("""select
gen_id(buyer_id_gen,1) from dummy""") # dummy(dummy
char(1))
            rst=cur.fetchone()
            if len(rst)==0:
                con.rollback()
                closeConnection(con)
                return 0
            else:
                con.commit()
                closeConnection(con)
                return str(rst[0]).strip()
        except Exception,err:
            writeError("Error : %s" %str(err))
            con.rollback()
            closeConnection(con)
            return 0

Now when I try to acces it through a cgi script like:

import dbInterface,cgi,cgitb
....
....
if buyerID is None:
    buyerID=dbInterface.createNewBuyer()

Then it does nothing and gives an error in the connect
function as:

21/5/2003  13:53:32 --> Error : (-904,
'attach_db.isc_attach_database: unavailable database.
')

First I thought that there is some error with my code
itself. To check this I tried these functions
in the Python interprator (Command Prompt). But there
it runs successfully, no error...

After thinking a lot I was unable to know the cause of
the problem. 

Please help me...

The configuration I am using...
Windows 2k professional
Python 2.2.2
KInterbasDB 3.0.2
FirebirdSQL WI-V6.2.908 Firebird 1.0
Apache 2.0.44

TIA and Kind Regards
Vivek Kumar

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com



More information about the DB-SIG mailing list