Problem with Python module

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • maneeshsingh82@gmail.com

    #1

    Problem with Python module

    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.D riverConnect('D SN=database;UID =user;PWD=passw d')
    c = db.cursor()
    c.execute('sele ct count(*) from test')
    c.fetchone()

    c.tables(None,N one,None,None)

    mx.ODBC.print_r esultset(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: SQLSetConfigMod e
    [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_A sEncodedString
    Thanks!


    Maneesh Singh.

  • Diez B. Roggisch

    #2
    Re: Problem with Python module

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

    --
    Regards,

    Diez B. Roggisch

    Comment

    • Steve Holden

      #3
      Re: Problem with Python module

      Diez B. Roggisch wrote:
      [color=blue][color=green]
      >>I have tried using the mxODBC package from eGenix.[/color]
      >
      >
      > 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.
      >[/color]

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


      Holden Web LLC +1 800 494 3119

      Comment

      Working...