[egenix-users]
unixODBC Connect raises NotSupportedError [unixODBC]Option not
supported
Frey, Peter
Peter.Frey at haufe.de
Thu Jul 27 16:37:08 CEST 2006
Hi,
I am evaluating mxODBC for a data transfer/transformation task from a
SQLServer 2005 database (running on a Windows2003 server) to a PosgreSQL
Server (under Debian linux)
The problem: when I try to connect to the SQL Server through mxODBC with
the following python statement, I get an mxODBC.NotSupportedError
exception.
Details:
When I execute the statement is
Database = import_database('unixODBC')
conn = Database.Connect('MSSQLDev0', user='sa', password='***')
I get the exception
mxODBC.NotSupportedError: ('S1C00', 1, '[unixODBC]Option not
supported', 5921)
Note: import_database is:
def import_database(pkgname):
try:
Database = __import__('mx.ODBC.%s' % pkgname, locals(),
globals(), '*')
except ImportError,why:
raise RuntimeError, 'Import of mx.ODBC.%s failed: %s' %
(pkgname,why)
return Database
(similar to what I saw in site-packages/mx/ODBC/Misc/test.py)
The same error message is also returned when running
site-packages/mx/ODBC/Misc/test.py
python /usr/lib/python2.4/site-packages/mx/ODBC/Misc/test.py
Subpackage Name [MySQL]: unixODBC
DriverConnect arguments [DSN=mysql;UID=root;PWD=mysql-admin]:
DSN=MSSQLDev0;UID=sa;PWD=***
(remaining options left default)
Testing package mx.ODBC.unixODBC version: 2.0.5
compiled with Unicode support
using Python version: 2.4
Test suite:
Connecting to the database.
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/mx/ODBC/Misc/test.py", line
2346, in ?
rc = main(packagename)
File "/usr/lib/python2.4/site-packages/mx/ODBC/Misc/test.py", line
2278, in main
connection = apply(connectapi,connectargs)
mxODBC.NotSupportedError: ('S1C00', 1, '[unixODBC]Option not
supported', 5921)
I tested also connecting to a local PostgreSQL server and it works as
expected.
The problem must be on the mxODBC side, as both tsql and isql from
FreeTDS work without problems with the same datasource.
I checked also the ODBC troubleshooting section in the FreeTDS
documentation, but
isql -v MSSQLDev0 sa ***
Works without any problem, I can connect to the SQLServer and issue
SELECT statemens without problems.
My .odbc.ini contains the following datasource definition for MSSQLDev0:
[MSSQLDev0]
Description = ARSystem database under Microsoft SQLServer 2005 on
vg100hrsdev0
Driver = FreeTDS
Server = vg100hrsdev0
Database = ARSystem
Port = 1433
Database = ARSystem
Using ODBC driver FreeTDS as set up by unixODBC in /etc/odbcinst.ini:
[FreeTDS]
Description = TDS driver (Sybase/MS SQL)
Driver = /usr/lib/odbc/libtdsodbc.so
Setup = /usr/lib/odbc/libtdsS.so
CPTimeout =
CPReuse =
FileUsage = 1
I first had this problem using FreeTDS from the Debian (stable) package
freetds-dev 0.61-6.2.
I deinstalled it and compiled freetds 0.64 from source, but this did not
solve my problem, still same error message.
So, which Option is not supported by mxODBC or the FreeTDS ODBC driver?
Peter
More information about the egenix-users
mailing list