Closed Thread Icon

Topic awaiting preservation: Problem in Python (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=23989" title="Pages that link to Topic awaiting preservation: Problem in Python (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Problem in Python <span class="small">(Page 1 of 1)</span>\

 
maneeshsingh
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Nov 2004

posted posted 11-10-2004 18:52

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.

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 11-10-2004 20:55

This is most likely a problem that should be addressed to the eGenix support, they have a mailing list which might be helpful.

Did you try to google for the problem? I found a couple of references just pasting in your error code.

I would hazard the guess that the problem is based on installation, but since I haven't use this program on your platform (and you most likely will not find anyone here who has) I cannot talk with any authority. You really should try the eGenix support and in particular their mailing list if you have no purchased a commercial support package with eGenix.

If that doesn't fix you problem you might try a different module for your database communication.

Dan @ Code Town

maneeshsingh
Obsessive-Compulsive (I) Inmate

From:
Insane since: Nov 2004

posted posted 11-11-2004 11:46

Hi WarMage,

The current problem is :
ImportError: /usr/lib/python2.3/site-packages/mx/ODBC/iODBC/mxODBC.so: undefined symbol: SQLSetConfigMode

The problem :
ImportError: /usr/lib/python2.3/site-packages/mx/ODBC/iODBC/mxODBC.so: undefined symbol: PyUnicodeUCS2_AsEncodedString
has been solved.

It more like you install this way you have thi problem and then if install through another source you have another problem. I have googled long enough to know that I cannot solve both these problems together through a method of installation or otherwise available, as if now, on any mailing list.

The problem with the eGenix non-commercial, I am having trouble subscribing there, i.e. uptill now.

Thanks for the reply. I still where I started.

Maneesh.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 11-11-2004 14:18

Well, both problems read as if they were compiled for something else than your current system.
An undefined symbol comes from having compiled for a different shared library than the one you actually have - so you're sure you compiled everything correctly?

maneeshsingh
Obsessive-Compulsive (I) Inmate

From:
Insane since: Nov 2004

posted posted 11-11-2004 16:40

Hi Tyberius,

Yes, I copmpiled everything correctly. Four hours with 2 more people has been spent on this. The compilation is definitely correct. The SQLSetConfigMode function exists in a C file which has to get compiled for the iODBC module (requird for mxODBC module) untill the make files provided are incorrect.

Maneesh.

« BackwardsOnwards »

Show Forum Drop Down Menu