From jean.baltus at africamuseum.be Mon Oct 2 14:43:18 2006 From: jean.baltus at africamuseum.be (BALTUS Jean) Date: Mon Oct 2 13:43:30 2006 Subject: [egenix-users] egenix does not find unixodbc library Message-ID: Hi all, I've an Ubuntu 6.06, Zope 2.9.4 with python 2.4.3 UCS 4, freetds 0.61 (source) and unixodbc 2.2.5 (source). The zope process runs under user 'tony'. I've set the owner of the freetds and unixodbc files to this same user. I'm able to connect to our database with isql or tsql. I've installed the correct egenix mxodbc-zopeda version and get the following message when zope starts: eGenix mxODBC Zope DA: trying iODBC interface... failed: libiodbc.so.2: cannot open shared object file: No such file or directory eGenix mxODBC Zope DA: trying unixODBC interface... failed: libodbc.so.1: cannot open shared object file: No such file or directory eGenix mxODBC Zope DA: No usable mxODBC subpackages found. The file libodbc.so.1 exists but egenix does not find it. Do I have to set up something? Thank you in advance, Jean P.S. With Zope 2.7 and python 2.3 using the same config, I did not get any error. ########################################### This message has been scanned by ICT - Africa Museum ________________________________________ 2/10/2006 - Filtered through antispam by ICT -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20061002/2764cef1/attachment.htm From mal at egenix.com Mon Oct 2 14:56:15 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Oct 2 13:56:25 2006 Subject: [egenix-users] egenix does not find unixodbc library In-Reply-To: References: Message-ID: <4520FE5F.6040701@egenix.com> BALTUS Jean wrote: > Hi all, > > > > I've an Ubuntu 6.06, Zope 2.9.4 with python 2.4.3 UCS 4, freetds 0.61 > (source) and unixodbc 2.2.5 (source). > > > > The zope process runs under user 'tony'. > > I've set the owner of the freetds and unixodbc files to this same user. > > > > I'm able to connect to our database with isql or tsql. > > > > I've installed the correct egenix mxodbc-zopeda version and get the > following message when zope starts: > > > > eGenix mxODBC Zope DA: trying iODBC interface... failed: libiodbc.so.2: > cannot open shared object file: No such file or directory > > eGenix mxODBC Zope DA: trying unixODBC interface... failed: > libodbc.so.1: cannot open shared object file: No such file or directory > > eGenix mxODBC Zope DA: No usable mxODBC subpackages found. > > > > The file libodbc.so.1 exists but egenix does not find it. Do I have to > set up something? It is possible that the linker doesn't know about the file: ldconfig -p should list it. Note that it's also possible that libodbc.so.1 requires another library that the linker doesn't find. Try running ldd /path/to/libodbc.so.1 as the user you run Zope under. It should print out a list of libs such as (the example output is from a 64-bit SuSE system): libdl.so.2 => /lib64/libdl.so.2 (0x0000002a956e0000) libpthread.so.0 => /lib64/tls/libpthread.so.0 (0x0000002a957e3000) libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a958f8000) /lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000) -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 02 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From jean.baltus at africamuseum.be Mon Oct 2 15:35:21 2006 From: jean.baltus at africamuseum.be (BALTUS Jean) Date: Mon Oct 2 14:35:27 2006 Subject: [egenix-users] egenix does not find unixodbc library Message-ID: Yes indeed ! I've added the unixodbc/lib directory to ldconfig and it worked. Now I'm able to add a database connection in Zope but the login fails. Is it possible that it's because we use special characters in the password? With isql for instance I have to surround the password with quote: isql dsn login 'password' kind regards, Jean -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: lundi 2 octobre 2006 13:56 To: BALTUS Jean Cc: egenix-users@egenix.com Subject: Re: [egenix-users] egenix does not find unixodbc library It is possible that the linker doesn't know about the file: ldconfig -p should list it. Note that it's also possible that libodbc.so.1 requires another library that the linker doesn't find. Try running ldd /path/to/libodbc.so.1 as the user you run Zope under. It should print out a list of libs such as (the example output is from a 64-bit SuSE system): libdl.so.2 => /lib64/libdl.so.2 (0x0000002a956e0000) libpthread.so.0 => /lib64/tls/libpthread.so.0 (0x0000002a957e3000) libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a958f8000) /lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000) -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 02 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: ########################################### This message has been scanned by ICT - Africa Museum ________________________________________ 2/10/2006 - Filtered through antispam by ICT From jean.baltus at africamuseum.be Mon Oct 2 15:45:57 2006 From: jean.baltus at africamuseum.be (BALTUS Jean) Date: Mon Oct 2 14:46:04 2006 Subject: [egenix-users] egenix does not find unixodbc library Message-ID: Disregard my question about the 'login failed'. If you type the Database Connection String on one line, it works. Thank you for your help Marc-Andre Lemburg ! Great product :) -- Jean -----Original Message----- From: egenix-users-bounces@egenix.com [mailto:egenix-users-bounces@egenix.com] On Behalf Of BALTUS Jean Sent: lundi 2 octobre 2006 14:35 To: egenix-users@egenix.com Subject: RE: [egenix-users] egenix does not find unixodbc library Yes indeed ! I've added the unixodbc/lib directory to ldconfig and it worked. Now I'm able to add a database connection in Zope but the login fails. Is it possible that it's because we use special characters in the password? With isql for instance I have to surround the password with quote: isql dsn login 'password' kind regards, Jean -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: lundi 2 octobre 2006 13:56 To: BALTUS Jean Cc: egenix-users@egenix.com Subject: Re: [egenix-users] egenix does not find unixodbc library It is possible that the linker doesn't know about the file: ldconfig -p should list it. Note that it's also possible that libodbc.so.1 requires another library that the linker doesn't find. Try running ldd /path/to/libodbc.so.1 as the user you run Zope under. It should print out a list of libs such as (the example output is from a 64-bit SuSE system): libdl.so.2 => /lib64/libdl.so.2 (0x0000002a956e0000) libpthread.so.0 => /lib64/tls/libpthread.so.0 (0x0000002a957e3000) libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a958f8000) /lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000) -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 02 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: ########################################### This message has been scanned by ICT - Africa Museum ________________________________________ 2/10/2006 - Filtered through antispam by ICT _______________________________________________________________________ eGenix.com User Mailing List http://www.egenix.com/ https://www.egenix.com/mailman/listinfo/egenix-users ########################################### This message has been scanned by ICT - Africa Museum ________________________________________ 2/10/2006 - Filtered through antispam by ICT From mal at egenix.com Mon Oct 2 15:48:40 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Oct 2 14:48:45 2006 Subject: [egenix-users] egenix does not find unixodbc library In-Reply-To: References: Message-ID: <45210AA8.5000306@egenix.com> BALTUS Jean wrote: > Disregard my question about the 'login failed'. If you type the Database > Connection String on one line, it works. > > Thank you for your help Marc-Andre Lemburg ! Great product :) Thanks :-) > -- Jean > > > -----Original Message----- > From: egenix-users-bounces@egenix.com > [mailto:egenix-users-bounces@egenix.com] On Behalf Of BALTUS Jean > Sent: lundi 2 octobre 2006 14:35 > To: egenix-users@egenix.com > Subject: RE: [egenix-users] egenix does not find unixodbc library > > Yes indeed ! I've added the unixodbc/lib directory to ldconfig and it > worked. > > Now I'm able to add a database connection in Zope but the login fails. > Is it possible that it's because we use special characters in the > password? > > With isql for instance I have to surround the password with quote: > > isql dsn login 'password' > > kind regards, > > Jean > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: lundi 2 octobre 2006 13:56 > To: BALTUS Jean > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] egenix does not find unixodbc library > > > It is possible that the linker doesn't know about the file: > > ldconfig -p > > should list it. > > Note that it's also possible that libodbc.so.1 requires another > library that the linker doesn't find. Try running ldd > /path/to/libodbc.so.1 > as the user you run Zope under. It should print out a list of libs such > as (the example output is from a 64-bit SuSE system): > > libdl.so.2 => /lib64/libdl.so.2 (0x0000002a956e0000) > libpthread.so.0 => /lib64/tls/libpthread.so.0 > (0x0000002a957e3000) > libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a958f8000) > /lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 > (0x000000552aaaa000) > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 02 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From iuato at samurai.com.br Tue Oct 10 15:10:26 2006 From: iuato at samurai.com.br (Marcos Iuato) Date: Tue Oct 10 19:11:40 2006 Subject: [egenix-users] Zope stops to respond Message-ID: <452BD402.1040700@samurai.com.br> I am trying to connect from a linux machine to a MS SQL Server, all the installation and configuration seems to be working, but when I run some query, the zope stops to respond. Someone knows what I am missing or could be wrong? ---------------------- :Packets and versions: ---------------------- debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep odbc ii odbcinst1 2.2.4-11 Support library and helper program for acces ii unixodbc 2.2.4-11 ODBC tools libraries debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep "MS SQL" ii libct1 0.61-6.2 libraries for connecting to MS SQL and Sybas ii sqsh 2.1-6 commandline SQL client for MS SQL and Sybase Zope Version (Zope 2.7.9-final, python 2.3.5, linux2) Python Version 2.3.5 (#2, Sep 4 2005, 22:01:42) [GCC 3.3.5 (Debian 1:3.3.5-13)] mxODBCZopeDA-1.0.10 --------------- :Configuration: --------------- debian:/etc# cat /etc/freetds/freetds.conf [MONET] host = 192.168.0.130 port = 1433 tds version = 8.0 debian:/etc# cat /etc/odbc.ini [mssql] Driver = /usr/lib/odbc/libtdsodbc.so Description = MS SQL running on monet Trace = No Servername = MONET Database = AfariaDB eGenix mxODBC Database Connection eGenix mxODBC Database Connection at /mssqlserver: Connection Id mssqlserver Connection Title Database Connection Source DSN=mssql ODBC Manager/Driver unixODBC Connection Information Connected database: SQL Server, unknown version ODBC driver: libtdsodbc.so, 0.61 Database Timezone Local Time Zone Connection Options * Database Warnings are reported as Python exceptions. * Connection uses transactions. * Time columns are returned as DateTime values. * Date/time columns are returned as Zope DateTime values. * Short integers are fetched as short integers. * NULL values are returned as None. * Scale 0 floats are converted to integers. * The first available result set is fetched in queries. * Don't ignore the max_rows query parameter (this is a Z SQL parameter). Connection Pool Pool size: 1 Physical connections: 1 open Total number of mxODBC connections/cursors: (1, 0) Connection State connected (since 2006/10/10 12:36:20.323 GMT-3) ------------------- :Testing with sqsh: ------------------- debian:/opt/zopes/279-mxodbczopeda# sqsh -D AfariaDB -U samurai -S 192.168.0.130 sqsh-2.1 Copyright (C) 1995-2001 Scott C. Gray This is free software with ABSOLUTELY NO WARRANTY For more information type '\warranty' Password: 1> select count(*) from a_class 2> go ----------- 85 (1 row affected) Thanks in advance, Marcos Iuato From iuato at samurai.com.br Tue Oct 10 16:09:45 2006 From: iuato at samurai.com.br (Marcos Iuato) Date: Tue Oct 10 20:10:57 2006 Subject: [egenix-users] Zope stops to respond In-Reply-To: <452BD402.1040700@samurai.com.br> References: <452BD402.1040700@samurai.com.br> Message-ID: <452BE1E9.8080201@samurai.com.br> Enabling the log of freetds, i get: 2006-10-10 15:01:24.390802 processing result tokens. marker is fd(DONE) 2006-10-10 15:01:24.390839 inside tds_process_end() more_results = 0, was_cancelled = 0 2006-10-10 15:01:24.390883 inside tds_process_result_tokens() state is COMPLETED SQLGetFunctions: fFunction is 999 odbc: not implemented: SQLGetInfo: option/type 10000(SQL_XOPEN_CLI_YEAR) [category Added for ODBC 3.x] odbc: not implemented: SQLGetInfo: option/type 81(SQL_GETDATA_EXTENSIONS) [category Driver Information] Does it means that I can't use freetds to connect to an MS SQL Server 2000? Marcos Iuato escreveu: > I am trying to connect from a linux machine to a MS SQL Server, all the > installation and configuration seems to be working, but when I run some > query, the zope stops to respond. Someone knows what I am missing or > could be wrong? > > ---------------------- > :Packets and versions: > ---------------------- > > debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep odbc > ii odbcinst1 2.2.4-11 Support library and helper program for > acces > ii unixodbc 2.2.4-11 ODBC tools libraries > > debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep "MS SQL" > ii libct1 0.61-6.2 libraries for connecting to MS SQL and > Sybas > ii sqsh 2.1-6 commandline SQL client for MS SQL and > Sybase > > Zope Version > (Zope 2.7.9-final, python 2.3.5, linux2) > Python Version > 2.3.5 (#2, Sep 4 2005, 22:01:42) [GCC 3.3.5 (Debian 1:3.3.5-13)] > > mxODBCZopeDA-1.0.10 > > --------------- > :Configuration: > --------------- > > debian:/etc# cat /etc/freetds/freetds.conf > [MONET] > host = 192.168.0.130 > port = 1433 > tds version = 8.0 > > debian:/etc# cat /etc/odbc.ini > [mssql] > Driver = /usr/lib/odbc/libtdsodbc.so > Description = MS SQL running on monet > Trace = No > Servername = MONET > Database = AfariaDB > > > eGenix mxODBC Database Connection eGenix mxODBC Database Connection at > /mssqlserver: > > Connection Id mssqlserver > Connection Title > Database Connection Source DSN=mssql > ODBC Manager/Driver unixODBC > Connection Information Connected database: SQL Server, unknown version > ODBC driver: libtdsodbc.so, 0.61 > Database Timezone Local Time Zone > Connection Options > > * Database Warnings are reported as Python exceptions. > * Connection uses transactions. > * Time columns are returned as DateTime values. > * Date/time columns are returned as Zope DateTime values. > * Short integers are fetched as short integers. > * NULL values are returned as None. > * Scale 0 floats are converted to integers. > * The first available result set is fetched in queries. > * Don't ignore the max_rows query parameter (this is a Z SQL > parameter). > > Connection Pool Pool size: 1 > Physical connections: 1 open > Total number of mxODBC connections/cursors: (1, 0) > > Connection State connected (since 2006/10/10 12:36:20.323 GMT-3) > > ------------------- > :Testing with sqsh: > ------------------- > > debian:/opt/zopes/279-mxodbczopeda# sqsh -D AfariaDB -U samurai -S > 192.168.0.130 > sqsh-2.1 Copyright (C) 1995-2001 Scott C. Gray > This is free software with ABSOLUTELY NO WARRANTY > For more information type '\warranty' > Password: > 1> select count(*) from a_class > 2> go > > ----------- > 85 > > (1 row affected) > > > Thanks in advance, > Marcos Iuato > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > https://www.egenix.com/mailman/listinfo/egenix-users From jean.baltus at africamuseum.be Wed Oct 11 12:13:46 2006 From: jean.baltus at africamuseum.be (BALTUS Jean) Date: Wed Oct 11 11:13:55 2006 Subject: [egenix-users] Zope stops to respond Message-ID: Hi, Install the development package for freetds (and unix-odbc-bin?): apt-get -V install unixodbc apt-get -V install unixodbc-bin apt-get -V install freetds-dev Also, in the freetds.conf file, you can add: client charset = strip high-order byte Try to create a odbcinst.ini file : [FreeTDS] Description = TDS driver (Sybase/MS SQL) Driver = /usr/lib/odbc/libtdsodbc.so Setup = /usr/lib/odbc/libtdsS.so CPTimeout = CPReuse = FileUsage = 1 And in your odbc.ini file, use the 'FreeTDS' entry that you created in odbcinst.ini : [mssql] Driver = FreeTDS Description = MS SQL running on monet Trace = No Servername = MONET Database = AfariaDB On our Debian server, it did the trick... -- Jean Baltus -----Original Message----- From: egenix-users-bounces@egenix.com [mailto:egenix-users-bounces@egenix.com] On Behalf Of Marcos Iuato Sent: mardi 10 octobre 2006 19:10 To: egenix-users@egenix.com Subject: [egenix-users] Zope stops to respond I am trying to connect from a linux machine to a MS SQL Server, all the installation and configuration seems to be working, but when I run some query, the zope stops to respond. Someone knows what I am missing or could be wrong? ---------------------- :Packets and versions: ---------------------- debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep odbc ii odbcinst1 2.2.4-11 Support library and helper program for acces ii unixodbc 2.2.4-11 ODBC tools libraries debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep "MS SQL" ii libct1 0.61-6.2 libraries for connecting to MS SQL and Sybas ii sqsh 2.1-6 commandline SQL client for MS SQL and Sybase Zope Version (Zope 2.7.9-final, python 2.3.5, linux2) Python Version 2.3.5 (#2, Sep 4 2005, 22:01:42) [GCC 3.3.5 (Debian 1:3.3.5-13)] mxODBCZopeDA-1.0.10 --------------- :Configuration: --------------- debian:/etc# cat /etc/freetds/freetds.conf [MONET] host = 192.168.0.130 port = 1433 tds version = 8.0 debian:/etc# cat /etc/odbc.ini [mssql] Driver = /usr/lib/odbc/libtdsodbc.so Description = MS SQL running on monet Trace = No Servername = MONET Database = AfariaDB eGenix mxODBC Database Connection eGenix mxODBC Database Connection at /mssqlserver: Connection Id mssqlserver Connection Title Database Connection Source DSN=mssql ODBC Manager/Driver unixODBC Connection Information Connected database: SQL Server, unknown version ODBC driver: libtdsodbc.so, 0.61 Database Timezone Local Time Zone Connection Options * Database Warnings are reported as Python exceptions. * Connection uses transactions. * Time columns are returned as DateTime values. * Date/time columns are returned as Zope DateTime values. * Short integers are fetched as short integers. * NULL values are returned as None. * Scale 0 floats are converted to integers. * The first available result set is fetched in queries. * Don't ignore the max_rows query parameter (this is a Z SQL parameter). Connection Pool Pool size: 1 Physical connections: 1 open Total number of mxODBC connections/cursors: (1, 0) Connection State connected (since 2006/10/10 12:36:20.323 GMT-3) ------------------- :Testing with sqsh: ------------------- debian:/opt/zopes/279-mxodbczopeda# sqsh -D AfariaDB -U samurai -S 192.168.0.130 sqsh-2.1 Copyright (C) 1995-2001 Scott C. Gray This is free software with ABSOLUTELY NO WARRANTY For more information type '\warranty' Password: 1> select count(*) from a_class 2> go ----------- 85 (1 row affected) Thanks in advance, Marcos Iuato _______________________________________________________________________ eGenix.com User Mailing List http://www.egenix.com/ https://www.egenix.com/mailman/listinfo/egenix-users ########################################### This message has been scanned by ICT - Africa Museum ________________________________________ 11/10/2006 - Filtered through antispam by ICT From iuato at samurai.com.br Wed Oct 11 10:59:13 2006 From: iuato at samurai.com.br (Marcos Iuato) Date: Wed Oct 11 15:01:10 2006 Subject: [egenix-users] Zope stops to respond In-Reply-To: References: Message-ID: <452CEAA1.9090207@samurai.com.br> Hi Jean, I have installed the unixodbc-bin and freetds-dev, and made the configurations changes that you suggested, but it still not working. How can I debug that problem? Could somebody points some directions? debian:/etc# dpkg -l|grep MS ii freetds-dev 0.61-6.2 MS SQL and Sybase client library (static lib ii libct1 0.61-6.2 libraries for connecting to MS SQL and Sybas ii libsybdb3 0.61-6.2 libraries for connecting to MS SQL and Sybas ii mtools 3.9.9-2.1 Tools for manipulating MSDOS files ii sqsh 2.1-6 commandline SQL client for MS SQL and Sybase debian:/etc# dpkg -l|grep odbc ii gtkodbcconfig0 2.2.4-11 GTK-based ODBC configuration library ii libodbcinstq1 2.2.4-11 Qt-based ODBC configuration library ii odbcinst1 2.2.4-11 Support library and helper program for acces ii unixodbc 2.2.4-11 ODBC tools libraries ii unixodbc-bin 2.2.4-11 Graphical tools for ODBC management and brow ii unixodbc-dev 2.2.4-11 ODBC libraries for UNIX (development files) Thanks in advance, Marcos Iuato BALTUS Jean escreveu: > Hi, > > Install the development package for freetds (and unix-odbc-bin?): > > apt-get -V install unixodbc > apt-get -V install unixodbc-bin > apt-get -V install freetds-dev > > Also, in the freetds.conf file, you can add: > > client charset = strip high-order byte > > > Try to create a odbcinst.ini file : > > [FreeTDS] > Description = TDS driver (Sybase/MS SQL) > Driver = /usr/lib/odbc/libtdsodbc.so > Setup = /usr/lib/odbc/libtdsS.so > CPTimeout = > CPReuse = > FileUsage = 1 > > And in your odbc.ini file, use the 'FreeTDS' entry that you created in > odbcinst.ini : > > [mssql] > Driver = FreeTDS > Description = MS SQL running on monet > Trace = No > Servername = MONET > Database = AfariaDB > > On our Debian server, it did the trick... > > -- Jean Baltus > > > -----Original Message----- > From: egenix-users-bounces@egenix.com > [mailto:egenix-users-bounces@egenix.com] On Behalf Of Marcos Iuato > Sent: mardi 10 octobre 2006 19:10 > To: egenix-users@egenix.com > Subject: [egenix-users] Zope stops to respond > > I am trying to connect from a linux machine to a MS SQL Server, all the > installation and configuration seems to be working, but when I run some > query, the zope stops to respond. Someone knows what I am missing or > could be wrong? > > ---------------------- > :Packets and versions: > ---------------------- > > debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep odbc > ii odbcinst1 2.2.4-11 Support library and helper program for > > acces > ii unixodbc 2.2.4-11 ODBC tools libraries > > debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep "MS SQL" > ii libct1 0.61-6.2 libraries for connecting to MS SQL and > > Sybas > ii sqsh 2.1-6 commandline SQL client for MS SQL and > Sybase > > Zope Version > (Zope 2.7.9-final, python 2.3.5, linux2) > Python Version > 2.3.5 (#2, Sep 4 2005, 22:01:42) [GCC 3.3.5 (Debian 1:3.3.5-13)] > > mxODBCZopeDA-1.0.10 > > --------------- > :Configuration: > --------------- > > debian:/etc# cat /etc/freetds/freetds.conf > [MONET] > host = 192.168.0.130 > port = 1433 > tds version = 8.0 > > > > debian:/etc# cat /etc/odbc.ini > [mssql] > Driver = /usr/lib/odbc/libtdsodbc.so > Description = MS SQL running on monet > Trace = No > Servername = MONET > Database = AfariaDB > > > eGenix mxODBC Database Connection eGenix mxODBC Database Connection at > /mssqlserver: > > Connection Id mssqlserver > Connection Title > Database Connection Source DSN=mssql > ODBC Manager/Driver unixODBC > Connection Information Connected database: SQL Server, unknown version > ODBC driver: libtdsodbc.so, 0.61 > Database Timezone Local Time Zone > Connection Options > > * Database Warnings are reported as Python exceptions. > * Connection uses transactions. > * Time columns are returned as DateTime values. > * Date/time columns are returned as Zope DateTime values. > * Short integers are fetched as short integers. > * NULL values are returned as None. > * Scale 0 floats are converted to integers. > * The first available result set is fetched in queries. > * Don't ignore the max_rows query parameter (this is a Z SQL > parameter). > > Connection Pool Pool size: 1 > Physical connections: 1 open > Total number of mxODBC connections/cursors: (1, 0) > > Connection State connected (since 2006/10/10 12:36:20.323 GMT-3) > > ------------------- > :Testing with sqsh: > ------------------- > > debian:/opt/zopes/279-mxodbczopeda# sqsh -D AfariaDB -U samurai -S > 192.168.0.130 > sqsh-2.1 Copyright (C) 1995-2001 Scott C. Gray > This is free software with ABSOLUTELY NO WARRANTY > For more information type '\warranty' > Password: > 1> select count(*) from a_class > 2> go > > ----------- > 85 > > (1 row affected) > > > Thanks in advance, > Marcos Iuato > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > https://www.egenix.com/mailman/listinfo/egenix-users > ########################################### > > This message has been scanned by ICT - Africa Museum > > ________________________________________ > 11/10/2006 - Filtered through antispam by ICT > From iuato at samurai.com.br Wed Oct 11 18:21:48 2006 From: iuato at samurai.com.br (Marcos Iuato) Date: Wed Oct 11 22:23:04 2006 Subject: [egenix-users] Zope stops to respond In-Reply-To: <452CEAA1.9090207@samurai.com.br> References: <452CEAA1.9090207@samurai.com.br> Message-ID: <452D525C.1040701@samurai.com.br> Hi, unixODBC + FreeTDS seems to be working, testing with isql debian:/etc# isql mssql samurai samurai +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> select count(*) from a_class +------------+ | | +------------+ | 85 | +------------+ 1 rows affected 1 rows returned SQL> At ZMI the eGenix mxODBC Database Connection connects succesfull to the database, but when I run any query, it blocks all threads and zope doesnt respond anymore. I don't know where could be the problem, could someone give me some directions? Thanks in advance, Marcos Iuato Marcos Iuato escreveu: > Hi Jean, > > I have installed the unixodbc-bin and freetds-dev, and made the > configurations changes that you suggested, but it still not working. How > can I debug that problem? Could somebody points some directions? > > debian:/etc# dpkg -l|grep MS > ii freetds-dev 0.61-6.2 MS SQL and Sybase client library > (static lib > ii libct1 0.61-6.2 libraries for connecting to MS SQL and > Sybas > ii libsybdb3 0.61-6.2 libraries for connecting to MS SQL and > Sybas > ii mtools 3.9.9-2.1 Tools for manipulating MSDOS files > ii sqsh 2.1-6 commandline SQL client for MS SQL and > Sybase > > debian:/etc# dpkg -l|grep odbc > ii gtkodbcconfig0 2.2.4-11 GTK-based ODBC configuration library > ii libodbcinstq1 2.2.4-11 Qt-based ODBC configuration library > ii odbcinst1 2.2.4-11 Support library and helper program for > acces > ii unixodbc 2.2.4-11 ODBC tools libraries > ii unixodbc-bin 2.2.4-11 Graphical tools for ODBC management > and brow > ii unixodbc-dev 2.2.4-11 ODBC libraries for UNIX (development > files) > > Thanks in advance, > Marcos Iuato > > BALTUS Jean escreveu: > >> Hi, >> Install the development package for freetds (and unix-odbc-bin?): >> >> apt-get -V install unixodbc >> apt-get -V install unixodbc-bin >> apt-get -V install freetds-dev >> >> Also, in the freetds.conf file, you can add: >> client charset = strip high-order byte >> >> Try to create a odbcinst.ini file : >> [FreeTDS] >> Description = TDS driver (Sybase/MS SQL) >> Driver = /usr/lib/odbc/libtdsodbc.so >> Setup = /usr/lib/odbc/libtdsS.so >> CPTimeout = CPReuse = FileUsage = 1 >> >> And in your odbc.ini file, use the 'FreeTDS' entry that you created in >> odbcinst.ini : >> >> [mssql] >> Driver = FreeTDS >> Description = MS SQL running on monet >> Trace = No >> Servername = MONET >> Database = AfariaDB >> >> On our Debian server, it did the trick... >> >> -- Jean Baltus >> >> >> -----Original Message----- >> From: egenix-users-bounces@egenix.com >> [mailto:egenix-users-bounces@egenix.com] On Behalf Of Marcos Iuato >> Sent: mardi 10 octobre 2006 19:10 >> To: egenix-users@egenix.com >> Subject: [egenix-users] Zope stops to respond >> >> I am trying to connect from a linux machine to a MS SQL Server, all >> the installation and configuration seems to be working, but when I run >> some query, the zope stops to respond. Someone knows what I am missing >> or could be wrong? >> >> ---------------------- >> :Packets and versions: >> ---------------------- >> >> debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep odbc >> ii odbcinst1 2.2.4-11 Support library and helper program for >> >> acces >> ii unixodbc 2.2.4-11 ODBC tools libraries >> >> debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep "MS SQL" >> ii libct1 0.61-6.2 libraries for connecting to MS SQL and >> >> Sybas >> ii sqsh 2.1-6 commandline SQL client for MS SQL >> and Sybase >> >> Zope Version >> (Zope 2.7.9-final, python 2.3.5, linux2) >> Python Version >> 2.3.5 (#2, Sep 4 2005, 22:01:42) [GCC 3.3.5 (Debian 1:3.3.5-13)] >> >> mxODBCZopeDA-1.0.10 >> >> --------------- >> :Configuration: >> --------------- >> >> debian:/etc# cat /etc/freetds/freetds.conf >> [MONET] >> host = 192.168.0.130 >> port = 1433 >> tds version = 8.0 >> >> >> >> debian:/etc# cat /etc/odbc.ini >> [mssql] >> Driver = /usr/lib/odbc/libtdsodbc.so >> Description = MS SQL running on monet >> Trace = No >> Servername = MONET >> Database = AfariaDB >> >> >> eGenix mxODBC Database Connection eGenix mxODBC Database Connection at >> /mssqlserver: >> >> Connection Id mssqlserver >> Connection Title >> Database Connection Source DSN=mssql >> ODBC Manager/Driver unixODBC >> Connection Information Connected database: SQL Server, unknown >> version >> ODBC driver: libtdsodbc.so, 0.61 >> Database Timezone Local Time Zone >> Connection Options >> >> * Database Warnings are reported as Python exceptions. >> * Connection uses transactions. >> * Time columns are returned as DateTime values. >> * Date/time columns are returned as Zope DateTime values. >> * Short integers are fetched as short integers. >> * NULL values are returned as None. >> * Scale 0 floats are converted to integers. >> * The first available result set is fetched in queries. >> * Don't ignore the max_rows query parameter (this is a Z SQL >> parameter). >> >> Connection Pool Pool size: 1 >> Physical connections: 1 open >> Total number of mxODBC connections/cursors: (1, 0) >> >> Connection State connected (since 2006/10/10 12:36:20.323 GMT-3) >> >> ------------------- >> :Testing with sqsh: >> ------------------- >> >> debian:/opt/zopes/279-mxodbczopeda# sqsh -D AfariaDB -U samurai -S >> 192.168.0.130 >> sqsh-2.1 Copyright (C) 1995-2001 Scott C. Gray >> This is free software with ABSOLUTELY NO WARRANTY >> For more information type '\warranty' >> Password: >> 1> select count(*) from a_class >> 2> go >> >> ----------- >> 85 >> >> (1 row affected) >> >> >> Thanks in advance, >> Marcos Iuato >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> https://www.egenix.com/mailman/listinfo/egenix-users >> ########################################### >> >> This message has been scanned by ICT - Africa Museum >> >> ________________________________________ >> 11/10/2006 - Filtered through antispam by ICT >> > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > https://www.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 11 23:33:10 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Oct 11 22:33:16 2006 Subject: [egenix-users] Zope stops to respond In-Reply-To: <452D525C.1040701@samurai.com.br> References: <452CEAA1.9090207@samurai.com.br> <452D525C.1040701@samurai.com.br> Message-ID: <452D5506.8050900@egenix.com> Marcos Iuato wrote: > Hi, > > unixODBC + FreeTDS seems to be working, testing with isql > > debian:/etc# isql mssql samurai samurai > +---------------------------------------+ > | Connected! | > | | > | sql-statement | > | help [tablename] | > | quit | > | | > +---------------------------------------+ > SQL> select count(*) from a_class > +------------+ > | | > +------------+ > | 85 | > +------------+ > 1 rows affected > 1 rows returned > SQL> > > > At ZMI the eGenix mxODBC Database Connection connects succesfull to the > database, but when I run any query, it blocks all threads and zope > doesnt respond anymore. I don't know where could be the problem, could > someone give me some directions? It is likely that one of the ODBC calls to unixODBC/FreeTDS blocks and doesn't return for some reason. If you run unixODBC in trace mode, you should be able to see which ODBC call does not return. This might be a firewall issue or a DNS problem on the client and/or server side. FWIW, we have FreeTDS running with SQL Server 2k. Even though we don't recommend using FreeTDS's ODBC driver and recommend other drivers for this combination instead, we do test this setup. > Thanks in advance, > Marcos Iuato > > > Marcos Iuato escreveu: >> Hi Jean, >> >> I have installed the unixodbc-bin and freetds-dev, and made the >> configurations changes that you suggested, but it still not working. >> How can I debug that problem? Could somebody points some directions? >> >> debian:/etc# dpkg -l|grep MS >> ii freetds-dev 0.61-6.2 MS SQL and Sybase client library >> (static lib >> ii libct1 0.61-6.2 libraries for connecting to MS SQL >> and Sybas >> ii libsybdb3 0.61-6.2 libraries for connecting to MS SQL >> and Sybas >> ii mtools 3.9.9-2.1 Tools for manipulating MSDOS files >> ii sqsh 2.1-6 commandline SQL client for MS SQL >> and Sybase >> >> debian:/etc# dpkg -l|grep odbc >> ii gtkodbcconfig0 2.2.4-11 GTK-based ODBC configuration library >> ii libodbcinstq1 2.2.4-11 Qt-based ODBC configuration library >> ii odbcinst1 2.2.4-11 Support library and helper program >> for acces >> ii unixodbc 2.2.4-11 ODBC tools libraries >> ii unixodbc-bin 2.2.4-11 Graphical tools for ODBC management >> and brow >> ii unixodbc-dev 2.2.4-11 ODBC libraries for UNIX (development >> files) >> >> Thanks in advance, >> Marcos Iuato >> >> BALTUS Jean escreveu: >> >>> Hi, >>> Install the development package for freetds (and unix-odbc-bin?): >>> >>> apt-get -V install unixodbc >>> apt-get -V install unixodbc-bin >>> apt-get -V install freetds-dev >>> >>> Also, in the freetds.conf file, you can add: >>> client charset = strip high-order byte >>> >>> Try to create a odbcinst.ini file : >>> [FreeTDS] >>> Description = TDS driver (Sybase/MS SQL) >>> Driver = /usr/lib/odbc/libtdsodbc.so >>> Setup = /usr/lib/odbc/libtdsS.so >>> CPTimeout = CPReuse = FileUsage = 1 >>> >>> And in your odbc.ini file, use the 'FreeTDS' entry that you created in >>> odbcinst.ini : >>> >>> [mssql] >>> Driver = FreeTDS >>> Description = MS SQL running on monet >>> Trace = No >>> Servername = MONET >>> Database = AfariaDB >>> >>> On our Debian server, it did the trick... >>> >>> -- Jean Baltus >>> >>> >>> -----Original Message----- >>> From: egenix-users-bounces@egenix.com >>> [mailto:egenix-users-bounces@egenix.com] On Behalf Of Marcos Iuato >>> Sent: mardi 10 octobre 2006 19:10 >>> To: egenix-users@egenix.com >>> Subject: [egenix-users] Zope stops to respond >>> >>> I am trying to connect from a linux machine to a MS SQL Server, all >>> the installation and configuration seems to be working, but when I >>> run some query, the zope stops to respond. Someone knows what I am >>> missing or could be wrong? >>> >>> ---------------------- >>> :Packets and versions: >>> ---------------------- >>> >>> debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep odbc >>> ii odbcinst1 2.2.4-11 Support library and helper program for >>> >>> acces >>> ii unixodbc 2.2.4-11 ODBC tools libraries >>> >>> debian:/opt/zopes/279-mxodbczopeda# dpkg -l|grep "MS SQL" >>> ii libct1 0.61-6.2 libraries for connecting to MS SQL and >>> >>> Sybas >>> ii sqsh 2.1-6 commandline SQL client for MS SQL >>> and Sybase >>> >>> Zope Version >>> (Zope 2.7.9-final, python 2.3.5, linux2) >>> Python Version 2.3.5 (#2, Sep 4 2005, 22:01:42) [GCC 3.3.5 (Debian >>> 1:3.3.5-13)] >>> >>> mxODBCZopeDA-1.0.10 >>> >>> --------------- >>> :Configuration: >>> --------------- >>> >>> debian:/etc# cat /etc/freetds/freetds.conf >>> [MONET] >>> host = 192.168.0.130 >>> port = 1433 >>> tds version = 8.0 >>> >>> >>> >>> debian:/etc# cat /etc/odbc.ini >>> [mssql] >>> Driver = /usr/lib/odbc/libtdsodbc.so >>> Description = MS SQL running on monet >>> Trace = No >>> Servername = MONET >>> Database = AfariaDB >>> >>> >>> eGenix mxODBC Database Connection eGenix mxODBC Database Connection >>> at /mssqlserver: >>> >>> Connection Id mssqlserver Connection Title Database >>> Connection Source DSN=mssql ODBC Manager/Driver >>> unixODBC Connection Information Connected database: SQL >>> Server, unknown version >>> ODBC driver: libtdsodbc.so, 0.61 Database Timezone Local Time >>> Zone Connection Options >>> * Database Warnings are reported as Python exceptions. >>> * Connection uses transactions. >>> * Time columns are returned as DateTime values. >>> * Date/time columns are returned as Zope DateTime values. >>> * Short integers are fetched as short integers. >>> * NULL values are returned as None. >>> * Scale 0 floats are converted to integers. >>> * The first available result set is fetched in queries. >>> * Don't ignore the max_rows query parameter (this is a Z SQL >>> parameter). >>> Connection Pool Pool size: 1 >>> Physical connections: 1 open >>> Total number of mxODBC connections/cursors: (1, 0) >>> Connection State connected (since 2006/10/10 12:36:20.323 GMT-3) >>> >>> ------------------- >>> :Testing with sqsh: >>> ------------------- >>> >>> debian:/opt/zopes/279-mxodbczopeda# sqsh -D AfariaDB -U samurai -S >>> 192.168.0.130 >>> sqsh-2.1 Copyright (C) 1995-2001 Scott C. Gray >>> This is free software with ABSOLUTELY NO WARRANTY >>> For more information type '\warranty' >>> Password: >>> 1> select count(*) from a_class >>> 2> go >>> >>> ----------- >>> 85 >>> >>> (1 row affected) >>> >>> >>> Thanks in advance, >>> Marcos Iuato >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> https://www.egenix.com/mailman/listinfo/egenix-users >>> ########################################### >>> >>> This message has been scanned by ICT - Africa Museum >>> >>> ________________________________________ >>> 11/10/2006 - Filtered through antispam by ICT >>> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> https://www.egenix.com/mailman/listinfo/egenix-users > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > https://www.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 16 19:01:25 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Oct 16 18:01:29 2006 Subject: [egenix-users] ANN: pyc2py utility Message-ID: <4533ACD5.3090508@egenix.com> Hello, until we have a page up for this little tool, I thought I post it here. The tools helps in situations where you need .py files instead of .pyc files. ________________________________________________________________________ pyc2py - utility to convert PYC files into equivalent PY files ________________________________________________________________________ The tools lets you convert any .pyc file into a .py file which will import just like the .pyc file. The script also supports glob patterns (even on Windows), so you can do: pyc2py.py *.pyc Imports will run a tad slower, but that shouldn't matter if you run these files in an application server like Zope. Download: http://www.egenix.com/files/python/pyc2py.py License: eGenix Public License (BSD) Enjoy, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 16 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From kev at logicalware.com Tue Oct 17 18:02:11 2006 From: kev at logicalware.com (Kevin Campbell) Date: Tue Oct 17 18:02:17 2006 Subject: [egenix-users] mxODBCZopeDA unicode support Message-ID: <20061017160211.GQ31006@logicalware.com> Hi, I'm trying to set up unicode support in mxODBCZopeDA, and I can't seem to find any option to do so. There are examples for dealing with the mxodbc library, which involve setting stringformat = mx.ODBC.Windows.MIXED_STRINGFORMAT Unfortunately, there doesn't seem to be a configuration option for similar in the zope adapter. The only solution I can see is to subclass the zope adapter and override the connect() method, which would be less than ideal. Is this the only solution? Regards, Kevin -- Kevin Campbell Logicalware Ltd GPG Key: F480EC23 From charlie at egenix.com Tue Oct 17 19:16:26 2006 From: charlie at egenix.com (Charlie Clark) Date: Tue Oct 17 18:16:39 2006 Subject: [egenix-users] mxODBCZopeDA unicode support In-Reply-To: <20061017160211.GQ31006@logicalware.com> References: <20061017160211.GQ31006@logicalware.com> Message-ID: Am 17.10.2006, 18:02 Uhr, schrieb Kevin Campbell : > Hi, > I'm trying to set up unicode support in mxODBCZopeDA, and I can't seem to > find any option to do so. There are examples for dealing with the mxodbc > library, which involve setting > stringformat = mx.ODBC.Windows.MIXED_STRINGFORMAT > Unfortunately, there doesn't seem to be a configuration option for > similar > in the zope adapter. The only solution I can see is to subclass the zope > adapter and override the connect() method, which would be less than > ideal. > Is this the only solution? Currently the best solution is to use an ExternalMethod. Apart from the fact that you can't use ZSQL-Methods (well, you could if you pass in the rendered version) this is best way to do this in Zope. Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ Try mxODBC.Zope.DA for Windows, Mac OS, Linux, Solaris, FreeBSD for free! From kev at logicalware.com Wed Oct 18 18:46:04 2006 From: kev at logicalware.com (Kevin Campbell) Date: Wed Oct 18 18:46:12 2006 Subject: [egenix-users] mxODBCZopeDA unicode support In-Reply-To: References: <20061017160211.GQ31006@logicalware.com> Message-ID: <20061018164604.GV31006@logicalware.com> On Tue, Oct 17, 2006 at 06:16:26PM +0200, Charlie Clark wrote: > Am 17.10.2006, 18:02 Uhr, schrieb Kevin Campbell : > > >Hi, > >I'm trying to set up unicode support in mxODBCZopeDA, and I can't seem to > >find any option to do so. There are examples for dealing with the mxodbc > >library, which involve setting > > stringformat = mx.ODBC.Windows.MIXED_STRINGFORMAT > >Unfortunately, there doesn't seem to be a configuration option for > >similar > >in the zope adapter. The only solution I can see is to subclass the zope > >adapter and override the connect() method, which would be less than > >ideal. > >Is this the only solution? > > Currently the best solution is to use an ExternalMethod. Apart from the > fact that you can't use ZSQL-Methods (well, you could if you pass in the > rendered version) this is best way to do this in Zope. That's unfortunate. Having looked at using the adapter directly, it appears it does not allow query strings to be passed as unicode objects or deal with unicode at all in the query method. Rendering ZSQL methods embeds the parameters inside the query. It seems it is possible to work around this by subclassing the connection object, encoding all supplied data as utf-8, and mapping the results back to unicode objects. This isn't ideal. I guess there's no alternative solution unless either ZSQL methods can be redesigned to maintain a distinction between the query and parameters, or the query method of the mx.ODBC connection can be altered to accept unicode strings. Is the latter possible at all? Regards, Kevin -- Kevin Campbell Logicalware Ltd GPG Key: F480EC23 From mal at egenix.com Wed Oct 18 20:27:49 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Oct 18 19:27:54 2006 Subject: [egenix-users] mxODBCZopeDA unicode support In-Reply-To: <20061018164604.GV31006@logicalware.com> References: <20061017160211.GQ31006@logicalware.com> <20061018164604.GV31006@logicalware.com> Message-ID: <45366415.7000602@egenix.com> Kevin Campbell wrote: > On Tue, Oct 17, 2006 at 06:16:26PM +0200, Charlie Clark wrote: >> Am 17.10.2006, 18:02 Uhr, schrieb Kevin Campbell : >> >>> Hi, >>> I'm trying to set up unicode support in mxODBCZopeDA, and I can't seem to >>> find any option to do so. There are examples for dealing with the mxodbc >>> library, which involve setting >>> stringformat = mx.ODBC.Windows.MIXED_STRINGFORMAT >>> Unfortunately, there doesn't seem to be a configuration option for >>> similar >>> in the zope adapter. The only solution I can see is to subclass the zope >>> adapter and override the connect() method, which would be less than >>> ideal. >>> Is this the only solution? >> Currently the best solution is to use an ExternalMethod. Apart from the >> fact that you can't use ZSQL-Methods (well, you could if you pass in the >> rendered version) this is best way to do this in Zope. > > That's unfortunate. Having looked at using the adapter directly, it appears > it does not allow query strings to be passed as unicode objects or deal with > unicode at all in the query method. Rendering ZSQL methods embeds the > parameters inside the query. It seems it is possible to work around this by > subclassing the connection object, encoding all supplied data as utf-8, > and mapping the results back to unicode objects. This isn't ideal. > > I guess there's no alternative solution unless either ZSQL methods can be > redesigned to maintain a distinction between the query and parameters, or > the query method of the mx.ODBC connection can be altered to accept unicode > strings. Is the latter possible at all? The next release of our mxODBC Zope DA will have support for dealing with Unicode directly and also allow transparent encoding/decoding of queries and results. Note that the underlying mxODBC itself does work with Unicode, so this is currently only a limitation in the Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 18 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From adil.lotia at gmail.com Wed Oct 18 20:21:27 2006 From: adil.lotia at gmail.com (Adil Lotia) Date: Thu Oct 19 04:22:48 2006 Subject: [egenix-users] Help with setup Message-ID: <816b1d720610181921u6dc48586vcec82837cd4960fe@mail.gmail.com> Hi, I would like to connect to SQL Server 2005 from Python 2.4 running on Ubuntu Linux. I am still trying to come up to grips with how to get going on this, but at this point I am not sure if I am on the right track. Have I have not installed some piece or have I have messed up my environment by installing "too much" stuff?! Part of the problem is that I probably don't understand all the layers needed in this layer cake! I downloaded egenix-mx-commercial-2.0.7-py2.4_ucs4_1.i386.rpm and converted it to a .deb via 'alien' and installed it. (mxDateTime 2.0.6 is also installed) I then installed iODBC 3.52.3-1, and create this ~/odbc.ini file: [ODBC] Debug=1 Trace=0 DebugFile=/tmp/odbc-debugfile.log TraceFile=/tmp/odbc-tracefile.log TraceAutoStop=1 [ODBC Data Sources] TestReportDB=Test Reporting Database [TestReportDB] Driver=/usr/lib/python2.4/site-packages/mx/ODBC/unixODBC/mxODBC.so Description=SQL Server 2005 Database=dmarc_reporting LogonID=adminservices Password=xxxx Address=192.168.201.17,1423 Then tried to test the connection -- (Sort of following the doc on iODBC site.) alotia@gensym:/usr/lib$ iodbctest iODBC Demonstration program This program shows an interactive SQL processor Driver Manager: 03.52.0305.1107 Enter ODBC connect string (? shows list): ? DSN | Driver ------------------------------------------------------------------------------ TestReportDB | Test Reporting Database Enter ODBC connect string (? shows list): DSN=TestReportDB;UID=adminservices;PWD=xxxx 1: SQLDriverConnect = [iODBC][Driver Manager]libodbc.so.1: cannot open shared object file: No such file or directory (0) SQLSTATE=00000 ^^^^^^^^^^^ 2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003 alotia@gensym: At this point I was not sure if libiodbc and libodbc have the same functionality, but I thought I'll install it as well. Ended up installing libodbc from the unixODBC (2.2.11-11build1) package. Now, when I try iodbctest, I get: iODBC Demonstration program This program shows an interactive SQL processor Driver Manager: 03.52.0305.1107 Enter ODBC connect string (? shows list): ? DSN | Driver ------------------------------------------------------------------------------ TestReportDB | Test Reporting Database Enter ODBC connect string (? shows list): DSN=TestReportDB;UID=adminservices;PWD=xxxx 1: SQLDriverConnect = [iODBC][Driver Manager]/usr/lib/python2.4/site-packages/mx/ODBC/unixODBC/mxODBC.so: undefined symbol: _Py_NoneStruct (0) SQLSTATE=00000 2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003 alotia@gensym: I did some searching for _Py_NoneStruct, but I did not find any hits in the context of mxODBC. At this point I am not sure if I am completely on the wrong track. BTW, I have downloaded Microsoft's SQL Server 2005 JDBC driver, and used it to successfully connect to the DB using dbvis, so at least I know that I have no connectivity or authorization problems. Thanks for any help. Best, -Adil -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20061018/47477f17/attachment.htm From adil.lotia at gmail.com Thu Oct 19 12:41:24 2006 From: adil.lotia at gmail.com (Adil Lotia) Date: Thu Oct 19 22:17:02 2006 Subject: [egenix-users] Re: Help with setup In-Reply-To: <816b1d720610181921u6dc48586vcec82837cd4960fe@mail.gmail.com> References: <816b1d720610181921u6dc48586vcec82837cd4960fe@mail.gmail.com> Message-ID: <816b1d720610191141v17d20004p142d94ed81ee85c8@mail.gmail.com> I later realized that in the odb.ini file, > Driver=/usr/lib/python2.4/site-packages/mx/ODBC/unixODBC/mxODBC.so I was referring to .../unixODBC/.. when I had set up iODBC. I have changed that to .../iODBC/mxODBC.so, but still not gotten any further. -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20061019/2e467b3b/attachment.htm