[Zope] Windows ODBC and service mode problem

fowlertrainer at anonym.hu fowlertrainer at anonym.hu
Thu Mar 10 03:22:52 EST 2005


Hi !

I want to use ODBC connection in my Zope site.
It is working in my machine, but in another that is not: the mxODBC, and 
my special extension failed also.

def GetODBCHandle(ConnString):
    s=odbc.odbc(ConnString)
    return s

def ExecuteStmt(cdb,sql):
    cur=cdb.cursor()
    cur.execute(sql)


def OpenSQL(cdb,sql,limit):
    if (limit==0): return None
    cur=cdb.cursor()
    cur.execute(sql)
    dl=[]
    r={'desc':cur.description,'data':dl}
    while 1:
            rec=cur.fetchone()
            if not rec: break
            d={}
            for idx in range(len(cur.description)):
                ds=cur.description[idx]
                d[ds[0]]=rec[idx]
            dl.append(d)
            if not (limit<0):
               limit-=1
               if limit==0: break
    return r


'''
odh=GetODBCHandle('TESTDBISAM')
r=OpenSQL(odh,'select * from szamla\bank',-1)
print r
'''

Many way I trying, but it isn't working. But in native mode it is 
working (when I start this extension with this command: 
c:\Zope\bin\Python.exe ext.py).

I found a problem in Windows when I want to use this, or mxODBC code 
WITH SERVICE MODE RUNNING !

If I use another "service login user", not localsystem, that is working.

Is anyone know another way to prevent this problem ?

Thanx for help:
 ft



More information about the Zope mailing list