From: Robert B. <ro...@tr...> - 2011-01-25 23:46:59
|
MSSQL will let you set the TDS version you use when you connect. To my knowledge, when you have things set up correctly, you can connect to any version of Sybase. You may be using a TDS version that Sybase doesn't understand, if so you'd need to dumb it down to something lower. Regardless, if you're connecting to Sybase, you'll be better off with python-sybase. Now, what problem were you having connecting with it? > > when built without -DHAVE_FREETDS. It built and installed fine with > either of -DHAVE_FREETDS and -DHAVE_FREETDS=82 (I've freetds 0.82 from > Debian lenny), but then trying to import the Sybase module results in: > > >> > /usr/local/lib/python2.6/dist-packages/python_sybase-0.39-py2.6-linux-i686.egg/sybasect.so: undefined symbol: cs_config >> This symbol is defined by the ct library from Sybase, in your case you're replacing that with the freetds version. So, you may not have linked to freetds properly, or you may just need to add the directory where your freetds binaries are to LD_LIBRARY_PATH. Michał Sawicz wrote: > Dnia 2011-01-25, wto o godzinie 23:48 +0100, Michał Sawicz pisze: > >> And, as I wrote in the other e-mail, that's probably to be expected >> with pymssql trying to connect to (an old) sybase. >> > > I've confirmed that: > > >> 1> SET ARITHABORT ON; >> 2> go >> 1> SET CONCAT_NULL_YIELDS_NULL ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'CONCAT_NULL_YIELDS_NULL' on line 1 >> 1> SET ANSI_NULLS ON >> 2> go >> 1> SET ANSI_NULL_DFLT_ON ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'ANSI_NULL_DFLT_ON' on line 1 >> 1> SET ANSI_PADDING ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'ANSI_PADDING' on line 1 >> 1> SET ANSI_WARNINGS ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'ANSI_WARNINGS' on line 1 >> 1> SET ANSI_NULL_DFLT_ON ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'ANSI_NULL_DFLT_ON' on line 1 >> 1> SET CURSOR_CLOSE_ON_COMMIT ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'CURSOR_CLOSE_ON_COMMIT' on line 1 >> 1> SET QUOTED_IDENTIFIER ON; >> 2> go >> 1> SET IMPLICIT_TRANSACTIONS ON; >> 2> go >> Msg 102, Level 15, State 0, Server , Line 0 >> ASA Error -131: Syntax error near 'IMPLICIT_TRANSACTIONS' on line 1 >> > > As you can see most of the SET commands from _mssql fail. So I'm left > with python-sybase for good... I could patch pymssql probably, but > I'd rather not. > > |