Blank results using mxODBC against

Sandeep Gupta sandeep182 at hotmail.com
Wed Jun 19 10:50:30 EDT 2002


We are trying to connect to MS SQL Server from Linux, but we are only
receiving blank values in the query results.  The number of rows and columns
in the result is correct, but each result cell is blank.

As a test, we successfully used mxODBC against a local MySQL going through
unixODBC.

We then tried: Python2.2 --> mxODBC --> unixODBC --> inline TDS 1.6 --> MS
SQL Server
When I use isql with unixODBC, I am able to view the results of a simple
select.  That same select in mxODBC returns blank result values.

The python code I'm using is:
import mx.ODBC.unixODBC
db = mx.ODBC.unixODBC.DriverConnect('DSN=MSSQL')

c = db.cursor()

c.execute('select * from dbo.Source;')

mx.ODBC.print_resultset(c)


odbcinst.ini contains
==================
[SQLServer]
Description             = SQL Server driver for Linux
Driver          = /usr/lib/odbc-i02.so
FileUsage               = 1
==================

odbc.ini contains
==================
[MSSQL]
Description             = MSSQL Test DB
Driver          = SQLServer
Server          = <ip>
Port            = 1433
User            = <user>
Pass            = <pw>
Database                = <database>
majorver    = 5
minorver    = 0
Trace           = On
TraceFile               = /tmp/DB.out
==================


Thanks
Sandeep





More information about the Python-list mailing list