Problem with Python module

M

maneeshsingh82

Hi,

I'm trying to connect to a Microsoft SQL Server 2000 database through a
Fedora Core 2 machine, using python 2.3.

I have tried using the mxODBC package from eGenix.

The code is as follows:

--------------------------------
#!/usr/bin/python2.3

import mx.ODBC.iODBC

db = mx.ODBC.iODBC.DriverConnect('DSN=database;UID=user;PWD=passwd')
c = db.cursor()
c.execute('select count(*) from test')
c.fetchone()

c.tables(None,None,None,None)

mx.ODBC.print_resultset(c)
c.close()
db.close()
--------------------------------


This is the output that I get:

--------------------------------
[root@ps0778 cgi-bin]# python db5.py
Traceback (most recent call last):
File "db5.py", line 4, in ?
import mx.ODBC.iODBC
File "/usr/lib/python2.3/site-packages/mx/ODBC/iODBC/__init__.py",
line 8, in ?
from mxODBC import *
ImportError: /usr/lib/python2.3/site-packages/mx/ODBC/iODBC/mxODBC.so:
undefined symbol: SQLSetConfigMode
[root@ps0778 cgi-bin]#
--------------------------------


Could anyone tell me what could be the problem here?

I have installed eGenix's mxODBC from source, and if this is done
through RPM, then the error that we get is

ImportError: /usr/lib/python2.3/site-packages/mx/ODBC/iODBC/mxODBC.so:
undefined symbol: PyUnicodeUCS2_AsEncodedString
Thanks!


Maneesh Singh.
 
D

Diez B. Roggisch

I have tried using the mxODBC package from eGenix.

I can't help you on your actual problem - but I have successfully accessed
ms sql server from unix using unix-odbc and the freetds driver. Maybe using
these solves your problems.
 
S

Steve Holden

Diez said:
I can't help you on your actual problem - but I have successfully accessed
ms sql server from unix using unix-odbc and the freetds driver. Maybe using
these solves your problems.

You might also do well to ask the egenix support list. Marc-Andre is
very helpful when he has time, and (ulinke him) other users do have
access to Windows and SQL Server.

You can find it through www.egenix.com.

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top