Problem with Python module

maneeshsingh82 at gmail.com maneeshsingh82 at gmail.com
Wed Nov 10 18:47:31 CET 2004


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 at 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 at 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.




More information about the Python-list mailing list